* wip * wip * wip * wip * wip * wip * wip * #5 - bump dependencies * #43 - wip * #43 - add composer script * #43 - fix * #43 - fix * #43 - wip * #43 - ecs fix * #43 - cr fix * #43 - cr fix * #43 - fix * #62 - wip * #62 - wip * #62 - wip * #62 - fix * #62 - fix * #62 - fix * #62 - fix * #62 - fix * #62 - ecs fix Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
This commit is contained in:
@@ -35,10 +35,18 @@ class DashboardController extends Controller
|
||||
)
|
||||
->get();
|
||||
|
||||
$vacationRequests = VacationRequest::query()
|
||||
->latest("updated_at")
|
||||
->limit(3)
|
||||
->get();
|
||||
if ($user->can("listAll", VacationRequest::class)) {
|
||||
$vacationRequests = VacationRequest::query()
|
||||
->states(VacationRequestStatesRetriever::waitingForUserActionStates($user))
|
||||
->latest("updated_at")
|
||||
->limit(3)
|
||||
->get();
|
||||
} else {
|
||||
$vacationRequests = $user->vacationRequests()
|
||||
->latest("updated_at")
|
||||
->limit(3)
|
||||
->get();
|
||||
}
|
||||
|
||||
$holidays = Holiday::query()
|
||||
->whereDate("date", ">=", $now)
|
||||
@@ -63,6 +71,9 @@ class DashboardController extends Controller
|
||||
"pending" => $pending,
|
||||
"other" => $other,
|
||||
],
|
||||
"can" => [
|
||||
"listAllVacationRequests" => $user->can("listAll", VacationRequest::class),
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user