2.x - php

This commit is contained in:
Saeed Vaziry
2024-09-28 15:19:55 +02:00
parent f6bc04763b
commit 32993025de
21 changed files with 698 additions and 83 deletions

View File

@ -24,6 +24,11 @@ public static function getNavigationItemActiveRoutePattern(): string
return static::getRouteName().'*';
}
public static function canAccess(): bool
{
return auth()->user()?->can('viewAny', Server::class) ?? false;
}
public function getWidgets(): array
{
return [
@ -36,6 +41,7 @@ protected function getHeaderActions(): array
return [
Action::make('create')
->label('Create a Server')
->icon('heroicon-o-plus')
->url(Create::getUrl())
->authorize('create', Server::class),
];