@php $notesEnabled = \App\Models\Setting::where('key', 'notes_enabled')->value('value') ?? 0; $notesInterval = \App\Models\Setting::where('key', 'notes_interval')->value('value') ?? 2; $employee = auth('employee')->user(); $activeJob = null; $jobType = null; if ($employee) { // Check Guard Job $activeGuardJob = $employee->schedules()->where('schedules.status', 'active')->first(); if ($activeGuardJob) { $activeJob = $activeGuardJob; $jobType = 'guard'; } else { // Check Patroller Job $activePatrollerJob = $employee->patrollerSchedules()->where('patroller_schedules.job_status', 'in_progress')->first(); if ($activePatrollerJob) { $activeJob = $activePatrollerJob; $jobType = 'patroller'; } } } @endphp @if ($notesEnabled && $activeJob)
Regular protocol check-in for Duty #{{ $activeJob->duty_number }}