为了账号安全,请及时绑定邮箱和手机立即绑定

如何在 laravel 中创建一个可共享的链接到公共

如何在 laravel 中创建一个可共享的链接到公共

PHP
摇曳的蔷薇 2023-04-28 14:54:28
我有一个 laravel 项目,您只能使用电子邮件和密码进入该项目创建客户发票,有时管理员想使用 wtsapp 和电子邮件共享发票我们如何创建无需电子邮件和密码即可公开的链接?这是刀片代码示例<thead>    <tr  class="header" id="myHeader">        <th style="width: 20px">#</th>        <th>Customer</th>        <th>Units</th>        <th>Total</th>        <th>Sub Total</th>        <th>Recieved</th>        <th>Balance</th>        <th>Advance</th>        @if(Auth::user()->role < 3)            <th>A Benefit</th>            <th>Actual Ben</th>        @endif        <th>C Benefit</th>        <th>S Price</th>        <th>Date</th>        <th>Action</th>    </tr></thead>@if ( $invoice->received_amount < $invoice->subtotal  )    <td style="color: red" data-changein="subtotal">{{ $invoice->amount }}</td>@elseif ( $invoice->received_amount > $invoice->subtotal && $invoice->amount_left > 0  )    <td style="color: #CC9A2E" data-changein="subtotal">{{ $invoice->amount }}</td>@endif
查看完整描述

1 回答

?
HUWWW

TA贡献1874条经验 获得超12个赞

auth只需从具有中间件并且应该可以工作的路由组中删除 invoice 路由。

你的路线可能是这样的yourapp.com/invoice/{invoice_id}。唯一的问题是,如果知道发票 ID,任何人都可以阅读发票的内容。如果您使用增量 ID,情况可能会变得更糟。您可能需要考虑使用hashed_id列来防止这种情况发生。


查看完整回答
反对 回复 2023-04-28
  • 1 回答
  • 0 关注
  • 92 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信