sackey e839d40a99
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (push) Waiting to run
Initial commit
2025-07-30 17:15:50 +00:00

34 lines
1.0 KiB
PHP

<?php
namespace App\Livewire\Dashboard;
use App\Models\Appointment;
use App\Models\JobCard;
use Livewire\Component;
class DailySchedule extends Component
{
public function render()
{
$today = now()->startOfDay();
$schedule = [
'appointments' => Appointment::whereDate('scheduled_datetime', $today)
->with(['customer', 'vehicle'])
->orderBy('scheduled_datetime')
->get(),
'pickups' => JobCard::where('status', 'completed')
->whereDate('expected_completion_date', $today)
->with(['customer', 'vehicle'])
->get(),
'overdue' => JobCard::where('expected_completion_date', '<', now())
->whereNotIn('status', ['completed', 'delivered', 'cancelled'])
->with(['customer', 'vehicle'])
->limit(5)
->get(),
];
return view('livewire.dashboard.daily-schedule', compact('schedule'));
}
}