schema([ TextInput::make('name')->required()->maxLength(255), TextInput::make('email')->email()->required()->maxLength(255), TextInput::make('password')->password()->dehydrateStateUsing(fn ($state) => bcrypt($state)) ->required(fn (string $context) => $context === 'create'), Select::make('role') ->options(['admin' => 'Admin', 'staff' => 'Mitarbeiter']) ->required(), ]); } public static function table(Table $table): Table { return $table->columns([ TextColumn::make('name')->searchable(), TextColumn::make('email')->searchable(), TextColumn::make('role')->badge() ->color(fn (string $state) => $state === 'admin' ? 'danger' : 'gray'), TextColumn::make('created_at')->dateTime()->sortable(), ])->actions([EditAction::make(), DeleteAction::make()]); } public static function getPages(): array { return [ 'index' => Pages\ListUsers::route('/'), 'create' => Pages\CreateUser::route('/create'), 'edit' => Pages\EditUser::route('/{record}/edit'), ]; } }