-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edit user profile to remove avatar, and add location field
- Loading branch information
1 parent
49e8b93
commit da25bd2
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace App\Livewire; | ||
|
||
use Jeffgreco13\FilamentBreezy\Livewire\MyProfileComponent; | ||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Facades\Filament; | ||
use Filament\Forms\Components\Group; | ||
use Jeffgreco13\FilamentBreezy\Livewire\PersonalInfo; | ||
|
||
class PilsiProfileComponent extends PersonalInfo | ||
{ | ||
public array $only = ['name', 'email', 'location']; | ||
|
||
protected function getProfileFormSchema() | ||
{ | ||
$groupFields = Group::make([ | ||
$this->getNameComponent(), | ||
$this->getEmailComponent(), | ||
$this->getLocationComponent(), | ||
])->columnSpan(2); | ||
|
||
return ($this->hasAvatars) | ||
? [filament('filament-breezy')->getAvatarUploadComponent(), $groupFields] | ||
: [$groupFields]; | ||
} | ||
|
||
protected function getLocationComponent(): TextInput | ||
{ | ||
return TextInput::make('location') | ||
->required() | ||
->label(__('Location')); | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Pages; | ||
|
||
use Jeffgreco13\FilamentBreezy\Pages\MyProfilePage; | ||
|
||
class PilsiProfilePage extends MyProfilePage | ||
{ | ||
protected static ?string $navigationIcon = 'heroicon-o-user'; | ||
} |
This file contains 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