@extends('front_end.layouts.home') @php $showRightSidebar = false; @endphp @section('title', 'Notifications') @push('styles') @endpush @section('content')

Notifications

@if($unreadCount > 0)
@csrf
@endif

Stay updated with what's happening

@if($notifications->count() > 0)
@foreach($notifications as $notification)
{{ $notification->sender->name }}
@if(!$notification->seen) New @endif

{{ $notification->sender->name }} {{ $notification->text }}

{{ $notification->created_at->diffForHumans() }}
@switch($notification->type) @case('friend_request')
@csrf
View Profile
@break @case('post_like') @case('post_comment') @case('post_mention') @break @case('group_invite')
@csrf
View Group
@break @default @if(!$notification->seen)
@csrf
@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)
{{ $notification->sender->name }}
New

{{ $notification->sender->name }} {{ $notification->text }}

{{ $notification->created_at->diffForHumans() }}
@switch($notification->type) @case('friend_request')
@csrf
View Profile
@break @case('post_like') @case('post_comment') @case('post_mention') @break @case('group_invite')
@csrf
View Group
@break @default
@csrf
@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)
{{ $notification->sender->name }}
@if(!$notification->seen) New @endif

{{ $notification->sender->name }} {{ $notification->text }}

{{ $notification->created_at->diffForHumans() }}
@if($notification->type == 'friend_request' && !$notification->is_reacted)
@csrf
View Profile
@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)
{{ $notification->sender->name }}
@if(!$notification->seen) New @endif

{{ $notification->sender->name }} {{ $notification->text }}

{{ $notification->created_at->diffForHumans() }}
View Post @if(!$notification->seen)
@csrf
@endif
@endforeach
@else
No Post Notifications

You don't have any post-related notifications.

@endif
@push('scripts') @endpush @endsection