schema([ Forms\Components\Section::make('User Details') ->schema([ TextInput::make('name') ->label(__('filament.resource.user.form.name')) ->required() ->maxLength(255), TextInput::make('email') ->label(__('filament.resource.user.form.email')) ->email() ->required() ->maxLength(255), TextInput::make('password') ->label(__('filament.resource.user.form.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') ->label(__('filament.resource.user.form.role')) ->required(), ])->columns(2), Forms\Components\Section::make('Preferences') ->schema([ Forms\Components\Toggle::make('email_notifications_enabled') ->label(__('Email Notifications')) ->default(true), Select::make('theme_preference') ->label(__('Theme')) ->options([ 'light' => 'Light', 'dark' => 'Dark', ]) ->default('light'), Select::make('locale') ->label(__('Language')) ->options([ 'en' => 'English', 'de' => 'Deutsch', ]) ->default('en'), ])->columns(2), ]); } public static function table(Table $table): Table { return $table ->columns([ TextColumn::make('name')->label(__('filament.resource.user.table.name'))->searchable()->sortable(), TextColumn::make('email')->label(__('filament.resource.user.table.email'))->searchable()->sortable(), TextColumn::make('role.name')->label(__('filament.resource.user.table.role'))->searchable()->sortable(), ]) ->filters([ // ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]) ->emptyStateActions([ Tables\Actions\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'); } }