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

@ -23,6 +23,11 @@ class Index extends Page
public Server $server;
public static function canAccess(): bool
{
return auth()->user()?->can('viewAny', [Site::class, static::getServerFromRoute()]) ?? false;
}
public function getWidgets(): array
{
return [
@ -36,7 +41,8 @@ protected function getHeaderActions(): array
CreateAction::make()
->authorize(fn () => auth()->user()?->can('create', [Site::class, $this->server]))
->createAnother(false)
->label('Create a Site'),
->label('Create a Site')
->icon('heroicon-o-plus'),
];
}
}