This commit is contained in:
Adrian Hopek
2022-03-16 13:39:27 +01:00
parent 0076c04e88
commit e365de21cf
2 changed files with 18 additions and 5 deletions

View File

@@ -22,15 +22,19 @@ class VacationCalendarController extends Controller
?string $month = null,
): Response {
$month = Month::fromNameOrCurrent((string)$month);
$currentUser = $request->user();
$yearPeriod = $yearPeriodRetriever->selected();
$carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber());
$users = User::query()
->where("id", "!=", $currentUser->id)
->orderBy("last_name")
->orderBy("first_name")
->get();
$users->prepend($currentUser);
$calendar = $calendarGenerator->generate($carbonMonth);
return inertia("Calendar", [