@extends('includes.layout') @section('main-page-content')

All Notifications

@if($notifications->count() > 0)
@foreach($notifications as $notification) @php $isReceived = $notification->receiver_id == Auth::id(); $isSent = $notification->sender_id == Auth::id(); @endphp @endforeach
Title Description From/To Direction Type Date Status Actions
{{ Str::limit($notification->title, 30) }} {{ Str::limit($notification->short_description, 50) }} @if($isReceived) {{-- Show sender for received notifications --}} @if($notification->senderDetails) {{ Str::limit($notification->senderDetails->first_name . ' ' . $notification->senderDetails->last_name, 20) }} @else System @endif @else {{-- Show receiver for sent notifications --}} @if($notification->receiverDetails) {{ Str::limit($notification->receiverDetails->first_name . ' ' . $notification->receiverDetails->last_name, 20) }} @else System @endif @endif @if($isReceived) Received @else Sent @endif {{ ucfirst($notification->type) }} {{ $notification->created_at->format('M d, Y') }}
{{ $notification->created_at->format('H:i') }}
@if($isReceived) @if($notification->read == '0') Unread @else Read @endif @else Sent @endif @if($isReceived && $notification->read == '0') @else @if($isSent) Sent @else Read @endif @endif
{{ $notifications->links() }}
@else
No notifications yet

You'll see your notifications here when they arrive.

Test Notifications
@endif
@endsection @section('css-js') @endsection