@if (Auth::guard('web')->user()->user_type == 1 && Session::get('user_role') != 'freelancer') @php $client_notifications = \App\Models\ClientNotification::where('client_id', Auth::guard('web')->user()->id) ->latest() ->take(200) ->get(); $client_new_notifications = \App\Models\ClientNotification::where('is_read', 'unread') ->where('client_id', Auth::guard('web')->user()->id) ->latest() ->get(); @endphp @else @if (Auth::guard('web')->user()->user_type == 2 && Session::get('user_role') == 'client') {{--this is for freelancer he switch as a client--}} @php $client_notifications = \App\Models\ClientNotification::where('client_id', Auth::guard('web')->user()->id) ->latest() ->take(200) ->get(); $client_new_notifications = \App\Models\ClientNotification::where('is_read', 'unread') ->where('client_id', Auth::guard('web')->user()->id) ->latest() ->get(); @endphp @else {{--this is for freelancer and also for client when he switch as a freelancer--}} @php $freelancer_notifications = \App\Models\FreelancerNotification::where('freelancer_id', Auth::guard('web')->user()->id) ->latest()->take(200)->get(); $freelancer_new_notifications = \App\Models\FreelancerNotification::where('is_read', 'unread') ->where('freelancer_id', Auth::guard('web')->user()->id) ->latest()->get(); @endphp @endif @endif