components([ Section::make('User Details') ->components([ TextInput::make('name') ->required() ->maxLength(255), TextInput::make('email') ->email() ->required() ->maxLength(255), TextInput::make('password') ->password() ->dehydrateStateUsing(fn (string $state): string => bcrypt($state)) ->dehydrated(fn (?string $state): bool => filled($state)) ->required(fn (string $operation): bool => $operation === 'create') ->maxLength(255), Select::make('role_id') ->relationship('role', 'name') ->required(), ])->columns(2) ->columnSpanFull(), Section::make('Preferences') ->components([ Toggle::make('email_notifications_enabled') ->default(true), Select::make('theme_preference') ->options([ 'light' => 'Light', 'dark' => 'Dark', ]) ->default('light'), Select::make('locale') ->options([ 'en' => 'English', 'de' => 'Deutsch', ]) ->default('en'), ])->columns(2) ->columnSpanFull(), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name')->searchable()->sortable(), TextColumn::make('email')->searchable()->sortable(), TextColumn::make('role.name')->searchable()->sortable(), ]) ->filters([ // ]) ->actions([ EditAction::make(), ]) ->bulkActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]) ->emptyStateActions([ CreateAction::make(), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListUsers::route('/'), 'create' => Pages\CreateUser::route('/create'), 'edit' => Pages\EditUser::route('/{record}/edit'), ]; } public static function getNavigationGroup(): ?string { return __('filament.navigation.groups.user_management'); } public static function getNavigationLabel(): string { return __('filament.navigation.user_roles'); } }