v4 registration
I installed Filamentphp v4 and want to add two new fields to the Panel register page.
The code that worked in v3 does not work in v4. I am not getting any error messages!
Register.php
The code that worked in v3 does not work in v4. I am not getting any error messages!
Register.php
<?php
namespace App\Filament\Tenant\Pages\Auth;
use Filament\Auth\Pages\Register as PagesRegister;
class Register extends {
protected function getForms(): array {
return [
'form' => $this->form(
$this->makeForm()
->components([
$this->getFirstNameFormComponent(),
$this->getLastNameFormComponent(),
$this->getEmailFormComponent(),
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
])
->statePath('data'),
),
];
}
protected function getFirstNameFormComponent(): Component {
return TextInput::make('first_name')->required()->autocomplete('off')->live()
->extraAttributes([
'autocapitalize' => 'words',
]);
}
protected function getLastNameFormComponent(): Component {
return TextInput::make('last_name')->required()->autocomplete('off')->live()
->extraAttributes([
'autocapitalize' => 'words',
]);
}
}<?php
namespace App\Filament\Tenant\Pages\Auth;
use Filament\Auth\Pages\Register as PagesRegister;
class Register extends {
protected function getForms(): array {
return [
'form' => $this->form(
$this->makeForm()
->components([
$this->getFirstNameFormComponent(),
$this->getLastNameFormComponent(),
$this->getEmailFormComponent(),
$this->getPasswordFormComponent(),
$this->getPasswordConfirmationFormComponent(),
])
->statePath('data'),
),
];
}
protected function getFirstNameFormComponent(): Component {
return TextInput::make('first_name')->required()->autocomplete('off')->live()
->extraAttributes([
'autocapitalize' => 'words',
]);
}
protected function getLastNameFormComponent(): Component {
return TextInput::make('last_name')->required()->autocomplete('off')->live()
->extraAttributes([
'autocapitalize' => 'words',
]);
}
}