@if($notifications->count() > 0)
@foreach($notifications as $notification)
@if(!$notification->seen)
New
@endif
{{ $notification->sender->name }} {{ $notification->text }}
{{ $notification->created_at->diffForHumans() }}
@switch($notification->type)
@case('friend_request')
@break
@case('post_like')
@case('post_comment')
@case('post_mention')
@break
@case('group_invite')
@break
@default
@if(!$notification->seen)
@endif
@endswitch
@endforeach
{{ $notifications->links('pagination::bootstrap-5') }}
@else
No Notifications
You don't have any notifications yet.
@endif
@php
$unreadNotifications = $notifications->where('seen', false);
@endphp
@if($unreadNotifications->count() > 0)
@foreach($unreadNotifications as $notification)
New
{{ $notification->sender->name }} {{ $notification->text }}
{{ $notification->created_at->diffForHumans() }}
@switch($notification->type)
@case('friend_request')
@break
@case('post_like')
@case('post_comment')
@case('post_mention')
@break
@case('group_invite')
@break
@default
@endswitch
@endforeach
@else
No Unread Notifications
You've read all your notifications.
@endif
@php
$friendNotifications = $notifications->filter(function($notification) {
return in_array($notification->type, ['friend_request', 'friend_accept']);
});
@endphp
@if($friendNotifications->count() > 0)
@foreach($friendNotifications as $notification)
@if(!$notification->seen)
New
@endif
{{ $notification->sender->name }} {{ $notification->text }}
{{ $notification->created_at->diffForHumans() }}
@if($notification->type == 'friend_request' && !$notification->is_reacted)
@elseif($notification->type == 'friend_accept')
@endif
@endforeach
@else
No Friend Notifications
You don't have any friend-related notifications.
@endif
@php
$postNotifications = $notifications->filter(function($notification) {
return in_array($notification->type, ['post_like', 'post_comment', 'comment_reply', 'post_mention']);
});
@endphp
@if($postNotifications->count() > 0)
@foreach($postNotifications as $notification)
@if(!$notification->seen)
New
@endif
{{ $notification->sender->name }} {{ $notification->text }}
{{ $notification->created_at->diffForHumans() }}
@endforeach
@else
No Post Notifications
You don't have any post-related notifications.
@endif