mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
- 2.x - scripts
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
|
||||
use App\Actions\Projects\DeleteProject;
|
||||
use App\Models\Project;
|
||||
use App\Web\Pages\Servers\Page;
|
||||
use App\Web\Components\Page;
|
||||
use App\Web\Pages\Settings\Projects\Widgets\AddUser;
|
||||
use App\Web\Pages\Settings\Projects\Widgets\ProjectUsersList;
|
||||
use App\Web\Pages\Settings\Projects\Widgets\UpdateProject;
|
||||
@ -19,9 +19,11 @@ class Settings extends Page
|
||||
|
||||
protected static ?string $title = 'Project Settings';
|
||||
|
||||
protected static bool $shouldRegisterNavigation = false;
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()?->can('update', request()->route('project')) ?? false;
|
||||
return auth()->user()?->can('update', get_from_route(Project::class, 'project')) ?? false;
|
||||
}
|
||||
|
||||
public Project $project;
|
||||
@ -62,7 +64,7 @@ protected function getHeaderActions(): array
|
||||
try {
|
||||
app(DeleteProject::class)->delete(auth()->user(), $record);
|
||||
|
||||
$this->redirectRoute('filament.app.resources.projects.index');
|
||||
$this->redirectRoute(Index::getUrl());
|
||||
} catch (Exception $e) {
|
||||
Notification::make()
|
||||
->title($e->getMessage())
|
||||
|
Reference in New Issue
Block a user