feat(add Roles & Permission for Users)
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m18s

This commit is contained in:
2026-02-03 11:57:36 +01:00
parent f39651748d
commit 6a7a95f15b
16 changed files with 996 additions and 12 deletions

View File

@@ -2,9 +2,12 @@
namespace App\Filament\Resources\Users\Schemas;
use App\Models\User;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Schema;
use Illuminate\Support\Facades\Hash;
class UserForm
{
@@ -13,15 +16,26 @@ class UserForm
return $schema
->components([
TextInput::make('name')
->label(User::getAttributeLabel('name'))
->required(),
TextInput::make('email')
->label(User::getAttributeLabel('email'))
->label('Email address')
->email()
->required(),
DateTimePicker::make('email_verified_at'),
DateTimePicker::make('email_verified_at')
->label(User::getAttributeLabel('email_verified_at')),
TextInput::make('password')
->label(User::getAttributeLabel('password'))
->password()
->required(),
->dehydrated(fn ($state) => filled($state))
->dehydrateStateUsing(fn ($state) => Hash::make($state)),
Select::make('role')
->label(User::getAttributeLabel('role'))
->relationship('roles', 'name')
->multiple()
->preload()
->searchable()
]);
}
}