Overriding PersonalInfo doesn't work
Opened this issue · 4 comments
I have this class to let users update their first_name and last_name as well, but as soon as I click update the component springs back to its original one and it says "The name field is required"
class PersonalInfo extends BreezyPersonalInfo
{
public array $only = ['display_name', 'first_name', 'last_name', 'email'];
protected function getProfileFormSchema(): array
{
return [
Forms\Components\Group::make([
Forms\Components\Grid::make()
->schema([
Forms\Components\TextInput::make('first_name')
->required(),
Forms\Components\TextInput::make('last_name')
->required(),
])
->columns(2),
Forms\Components\TextInput::make('display_name')
->unique($this->userClass, ignorable: $this->user),
Forms\Components\TextInput::make('email')
->required()
->email()
->unique($this->userClass, ignorable: $this->user)
->label(__('filament-breezy::default.fields.email')),
])->columnSpan(3)
];
}
}```
I have the same issue.
One solution is to replace the Livewire components after panel boot:
use Jeffgreco13\FilamentBreezy\BreezyCore;
use App\Http\Livewire\CustomPersonalInfo;
class CustomersPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
...
->plugin(
BreezyCore::make()
->myProfile()
->myProfileComponents([
'personal_info' => CustomPersonalInfo::class,
])
)
->bootUsing(function () {
Livewire::component('personal_info', CustomPersonalInfo::class);
})
}
}
I have the same issue.
One solution is to replace the Livewire components after panel boot:
use Jeffgreco13\FilamentBreezy\BreezyCore; use App\Http\Livewire\CustomPersonalInfo; class CustomersPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel ... ->plugin( BreezyCore::make() ->myProfile() ->myProfileComponents([ 'personal_info' => CustomPersonalInfo::class, ]) ) ->bootUsing(function () { Livewire::component('personal_info', CustomPersonalInfo::class); }) } }
When I try to add the livewire component inside other folders like App/Livewire/Auth/Profile/Timezone.php
, when I click the save button, I get this error:
include(/var/www/html/vendor/composer/../../app/Livewire/ChangeTimezone.php): Failed to open stream: No such file or directory
Do you have any idea what it could be?
Breezy has had issues in the past with trying to use components outside of the main App/Livewire
folder:
It's probably related to that. I think the comment I linked is claiming there is a way around the issue but I've never tried it myself.