So i want to retrieve data from Notifications Table in laravel.
but what i am trying to do is showing notifications on public it means without an auth so it would show in here
if i do this it throws an error as undefined variable
@foreach( $notifications as $notif)
lob {{ $notif->type }}
@endforeach
and then i tried to count the unreadNotifications but it throws an error of
Trying to get property 'unreadNotifications' of non-object
what should i do in here? because after i search about this,
the solution always use auth()->user()->notifications() meanwhile what i am trying to do is showing notification in home.blade.php without any auth
Regards.