Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom profile gets no values #206

Closed
bernhardh opened this issue Aug 12, 2023 · 1 comment
Closed

Custom profile gets no values #206

bernhardh opened this issue Aug 12, 2023 · 1 comment

Comments

@bernhardh
Copy link

bernhardh commented Aug 12, 2023

I followed your instructions "Create custom My Profile components" and used it to overwrite the 'personal_info' section:

class MyProfileComponent extends \Jeffgreco13\FilamentBreezy\Livewire\MyProfileComponent
{
    protected string $view = "livewire.admin.my-profile-component";
    public array $data;


    public function form(Form $form): Form
    {
        return $form
            ->schema([
                Placeholder::make("test")
                    ->content(fn($record) => json_encode($record)),
                TextInput::make("name")
                    ->hint("Changable just by Admins")
                    ->disabled(fn(): bool => !auth()->user()->hasRole([User::ROLE_SUPER_ADMIN, User::ROLE_ADMIN]))
            ])
            ->statePath('data');
    }
}

This gives me the following:

image

As you can see, I can't access any data and the name field is empty, which is wrong.

Similar code worked in V1. I updated to v2.1.3.

@bernhardh bernhardh changed the title Custom profile gets not values Custom profile gets no values Aug 12, 2023
@bernhardh
Copy link
Author

Ah, forget it. I can just extend \Jeffgreco13\FilamentBreezy\Livewire\PersonalInfo and overwrite just the getProfileFormSchema method and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant