<?php

namespace App\Http\Controllers\Employee;

use App\Http\Controllers\Controller;
use App\Models\Booking;
use Illuminate\View\View;

class DashboardController extends Controller
{
    public function index(): View
    {
        $employee = auth()->user()->employee;

        $today = Booking::active()
            ->where('employee_id', $employee?->id)
            ->whereDate('booking_date', today())
            ->orderBy('start_time')
            ->get();

        return view('employee.dashboard', compact('employee', 'today'));
    }
}
