Integrate Spatie Laravel Permission to replace the legacy role system. This includes: - Adding `spatie/laravel-permission` dependency. - Implementing `Role` and `User` model updates with `HasRoles` trait. - Adding migrations for permission and role tables. - Creating `RoleResource` and `UserResource` for Filament administration. - Adding a `RoleAndPermissionSeeder` for initial setup. - Updating `User` model helper methods to utilize role checks.
20 lines
397 B
PHP
20 lines
397 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\UserResource\Pages;
|
|
|
|
use App\Filament\Resources\UserResource;
|
|
use Filament\Actions;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditUser extends EditRecord
|
|
{
|
|
protected static string $resource = UserResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Actions\DeleteAction::make(),
|
|
];
|
|
}
|
|
}
|