mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -29,7 +29,10 @@ public static function getNavigationItemActiveRoutePattern(): string
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('viewAny', Project::class) ?? false;
|
||||
/** @var \App\Models\User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
return $user->can('viewAny', Project::class);
|
||||
}
|
||||
|
||||
public function getWidgets(): array
|
||||
@ -47,15 +50,13 @@ protected function getHeaderActions(): array
|
||||
->icon('heroicon-o-plus')
|
||||
->authorize('create', Project::class)
|
||||
->modalWidth(MaxWidth::Large)
|
||||
->form(function (Form $form) {
|
||||
return $form->schema([
|
||||
TextInput::make('name')
|
||||
->name('name')
|
||||
->rules(CreateProject::rules()['name']),
|
||||
])->columns(1);
|
||||
})
|
||||
->action(function (array $data) {
|
||||
app(CreateProject::class)->create(auth()->user(), $data);
|
||||
->form(fn (Form $form): \Filament\Forms\Form => $form->schema([
|
||||
TextInput::make('name')
|
||||
->name('name')
|
||||
->rules(CreateProject::rules()['name']),
|
||||
])->columns(1))
|
||||
->action(function (array $data): void {
|
||||
app(CreateProject::class)->create($this->getUser(), $data);
|
||||
|
||||
$this->dispatch('$refresh');
|
||||
}),
|
||||
|
Reference in New Issue
Block a user