@if($notifications->count() > 0) @foreach ($notifications as $key => $notification) @php $user_data = ''; $notify_data = json_decode($notification->data); $link = env('APP_URL').$notify_data->url; @endphp @if($notify_data->type == 'express_interest') @php $userId = \App\Models\ExpressInterest::where('id', $notify_data->info_id)->first()->interested_by; $user_data = \App\Models\User::where('id',$userId)->first(); @endphp @elseif ($notify_data->type == 'accept_interest' || $notify_data->type == 'reject_interest') @php $userId = \App\Models\ExpressInterest::where('id', $notify_data->info_id)->first()->user_id; $user_data = \App\Models\User::where('id',$userId)->first(); @endphp @endif
{{ $user_data->first_name.' '.$user_data->last_name }}
{{ $notify_data->message }}