fixing routes

This commit is contained in:
Saeed Vaziry
2024-10-07 00:18:11 +02:00
parent a94d1d42d2
commit 8bf1cc141e
22 changed files with 70 additions and 522 deletions

View File

@ -38,7 +38,7 @@ public function getWidgets(): array
protected function getHeaderActions(): array
{
return [
CreateAction::make()
CreateAction::make('create')
->label('Create User')
->icon('heroicon-o-plus')
->authorize('create', User::class)

View File

@ -87,13 +87,6 @@ public function getTable(): Table
->label('Projects')
->icon('heroicon-o-rectangle-stack')
->authorize(fn ($record) => auth()->user()->can('update', $record))
->action(function ($record, array $data) {
app(UpdateProjects::class)->update($record, $data);
Notification::make()
->title('Projects Updated')
->success()
->send();
})
->form(function (Form $form, $record) {
return $form
->schema([
@ -105,10 +98,17 @@ public function getTable(): Table
])
->columns(1);
})
->action(function ($record, array $data) {
app(UpdateProjects::class)->update($record, $data);
Notification::make()
->title('Projects Updated')
->success()
->send();
})
->modalSubmitActionLabel('Save')
->modalWidth(MaxWidth::Large),
DeleteAction::make()
->authorize(fn ($record) => auth()->user()->can('delete', $record)),
DeleteAction::make('delete')
->authorize(fn (User $record) => auth()->user()->can('delete', $record)),
]);
}
}