user(); $yearPeriod = $yearPeriodRetriever->selected(); $carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber()); $users = User::query() ->where("id", "!=", $currentUser->id) ->orderByProfileField("last_name") ->orderByProfileField("first_name") ->get(); $users->prepend($currentUser); $calendar = $calendarGenerator->generate($carbonMonth); return inertia("Calendar", [ "calendar" => $calendar, "current" => Month::current(), "selected" => $month->value, "users" => SimpleUserResource::collection($users), "can" => [ "generateTimesheet" => $request->user()->can("generateTimesheet"), "createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee"), ], ]); } }