Filament custom Registration Form

Hey Y'all,
I did a custom register component to add a plan selection, made the relationship between users and plans and this is how it looks my register class:
class Register extends BaseRegister
{
    public Plan $plan;
    protected function getForms(): array
    {
        return [
            'form' => $this->form(
                $this->makeForm()
                    ->schema([
                        $this->getNameFormComponent(),
                        $this->getEmailFormComponent(),
                        $this->getPasswordFormComponent(),
                        $this->getPasswordConfirmationFormComponent(),
                        $this->getRoleFormComponent(),
                    ])
                    ->statePath('data'),
            ),
        ];
    }

    protected function getRoleFormComponent(): Component
    {
        return Select::make('Plan')
        ->relationship(name: 'plan', titleAttribute:'name')
            ->native(false)
            ->default('estandar')
            ->required();
    }
}

however, I'm getting an error Call to a member function isRelation() on null
https://flareapp.io/share/x7XZpMAm
Flare
Call to a member function isRelation() on null - The error occurred at http://localhost/petlinkadmin/register
Was this page helpful?