label(__('filament-panels::auth/pages/edit-profile.form.password_confirmation.label')) ->validationAttribute(__('filament-panels::auth/pages/edit-profile.form.password_confirmation.validation_attribute')) ->password() ->autocomplete('new-password') ->revealable(filament()->arePasswordsRevealable()) ->required() ->visible(fn (Get $get): bool => filled($get('password'))) ->dehydrated(false); } protected function getCurrentPasswordFormComponent(): Component { return TextInput::make('currentPassword') ->label(__('filament-panels::auth/pages/edit-profile.form.current_password.label')) ->validationAttribute(__('filament-panels::auth/pages/edit-profile.form.current_password.validation_attribute')) ->belowContent(__('filament-panels::auth/pages/edit-profile.form.current_password.below_content')) ->password() ->autocomplete('current-password') ->currentPassword(guard: Filament::getAuthGuard()) ->revealable(filament()->arePasswordsRevealable()) ->required() ->visible(fn (Get $get): bool => filled($get('password'))) ->dehydrated(false); } public function form(Schema $schema): Schema { return $schema ->schema([ Section::make('Profile') ->schema([ $this->getNameFormComponent(), $this->getEmailFormComponent(), TextInput::make('username') ->required() ->unique(ignoreRecord: true) ->maxLength(255), Select::make('preferred_locale') ->options([ 'de' => 'Deutsch', 'en' => 'English', ]) ->default('de') ->required(), ]) ->columns(2), Section::make('Security') ->schema([ $this->getPasswordFormComponent(), $this->getPasswordConfirmationFormComponent(), $this->getCurrentPasswordFormComponent(), ]) ->columns(1), Section::make('Support API Tokens') ->description('Manage bearer tokens for external support tooling.') ->schema([ Livewire::make('support-api-token-manager'), ]), ]); } }