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();
}
}
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();
}
}