• @can('show-notification')
  • @php $user = auth()->user(); $unreadNotificationsCount = $user->unreadNotifications()->count(); $allNotificationsCount = $user->notifications()->count(); $unreadNotifications = $user->unreadNotifications()->paginate(5); $allNotifications = $user->notifications()->paginate(10); @endphp
    • You have {{ $unreadNotificationsCount }} unread {{ $allNotificationsCount }}

    • {{-- --}}

      {{--
      --}}
    • @if($unreadNotificationsCount != 0) @foreach ($unreadNotifications as $notification)
    • {{ $notification->data['textSend'] }}

      {{ $notification->created_at->diffForHumans() }}
    • @endforeach @else @foreach ($allNotifications as $notification)
    • {{ $notification->data['textSend'] }}

      {{ $notification->created_at->diffForHumans() }}
    • @endforeach @endif
    • {{ __('Show All') }}
  • @endcan
  • @csrf