Created
February 7, 2024 17:33
-
-
Save joaopaulolndev/5cb9b4e8ba30c1d363c01427c93ba90d to your computer and use it in GitHub Desktop.
EditProfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Filament\Pages\Auth; | |
| use App\Helpers\CheckPermissionsHelper; | |
| use Filament\Forms\Components\Section; | |
| use Filament\Forms\Components\Select; | |
| use Filament\Forms\Components\TextInput; | |
| use Filament\Forms\Components\Toggle; | |
| use Filament\Forms\Form; | |
| use Filament\Pages\Auth\EditProfile as BaseEditProfile; | |
| class EditProfile extends BaseEditProfile | |
| { | |
| protected static string $view = 'filament.pages.auth.edit-profile'; | |
| protected static string $layout = 'filament-panels::components.layout.index'; | |
| protected function hasFullWidthFormActions(): bool | |
| { | |
| return false; | |
| } | |
| public static function getSlug(): string | |
| { | |
| return static::$slug ?? 'me'; | |
| } | |
| public function form(Form $form): Form | |
| { | |
| return $form | |
| ->schema([ | |
| Section::make(__('Profile Status')) | |
| ->columns(2) | |
| ->description(__('If you want to stop receiving new requests please turn off this field.')) | |
| ->aside() | |
| ->schema([ | |
| Toggle::make('active') | |
| ->label(__('Active')) | |
| ->helperText(__('When you are active you are able to receive new requests.')), | |
| ]), | |
| Section::make(__('Personal Information')) | |
| ->columns(2) | |
| ->description(__('Here you can change some personal information.')) | |
| ->aside() | |
| ->schema([ | |
| $this->getNameFormComponent(), | |
| $this->getEmailFormComponent() | |
| ->disabled(), | |
| $this->getPasswordFormComponent(), | |
| $this->getPasswordConfirmationFormComponent(), | |
| ]), | |
| ]); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment