【发布时间】:2020-05-29 00:46:56
【问题描述】:
所以我想从 laravel 的通知表中检索数据。
但我想做的是在公共场合显示通知,这意味着没有身份验证,所以它会在这里显示
如果我这样做,它会作为未定义变量引发错误
@foreach( $notifications as $notif)
lob {{ $notif->type }}
@endforeach
然后我尝试计算 unreadNotifications 但它抛出了一个错误
试图获取非对象的属性'unreadNotifications'
我应该在这里做什么?因为在我搜索了这个之后,
该解决方案始终使用auth()->user()->notifications() 同时我想要做的是在 home.blade.php 中显示通知而没有任何身份验证
问候。
【问题讨论】:
标签: php laravel notifications