@section('page-breadcrumb') @show
@if(isset($unchecked_notification) && $unchecked_notification > 0) {{$unchecked_notification > 0 ? $unchecked_notification : ''}} @endif
@if(auth()->user()->avatar) Logo @else Logo @endif
{{-- --}}
@php $notifications = DB::table('notifications') ->whereRaw('json_extract(data, "$.sender_id") = ?', [Auth::id()]) ->orderBy('created_at', 'desc') ->limit(12) ->get(); $unchecked_notification = DB::table('notifications') ->whereRaw('json_extract(data, "$.sender_id") = ?', [Auth::id()]) ->where('is_read', 0) ->count(); @endphp
@if(!empty($notifications)) @foreach($notifications as $notification) @php $notificationData = json_decode($notification->data, true); @endphp
{{$notificationData['title']}}
{{class_basename($notification->type)}}

{{$notificationData['message']}}

{{\Carbon\Carbon::parse(@$notification->created_at)->diffForHumans()}}
@endforeach @endif
@if(isset($notifications) && $notifications->count() > 0) @endif