@php $notificationUser = \App\Models\TaskHistory::where('task_id', $notification->data['id']) ->orderBy('id', 'desc') ->first(); $taskDet = \App\Models\Task::with('taskUsers','taskUsers.user','project','project.serviceOrder','project.serviceOrder')->where('id', $notification->data['id']) ->first(); //dd($taskDet); @endphp @if ($notificationUser) @endif