Forms

What are the default forms in the account area?

Class
Description
AccountAddressEditForm The edit address form.
AccountAddressNewForm The new address form.
AccountDetailsForm The account details form.
AccountLoginForm The login form.
AccountPasswordForgotForm The forgotten password form.
AccountPasswordResetForm The password reset form.
AccountRegisterForm The register form.

The above classes reside in the Aero\AccountArea\Http\Forms namespace.

How do I create a custom form in the account area?

To create a form you need to create a class that extends the \Aero\AccountArea\AccountAreaForm class:

For example, here's how the login form is defined:

class LoginForm extends \Aero\AccountArea\AccountAreaForm
{
    protected $sections = [
        'email' => 'account-area::partials.email-input',
        'password' => 'account-area::partials.password-input',
        'forgot-password' => 'account-area::partials.login-forgot-password-link',
        'submit' => 'account-area::partials.login-button',
    ];

    protected function method(): string
    {
        return 'post';
    }

    protected function route($data): string
    {
        return route('login');
    }
}

Don't forget to register your form:

\Aero\AccountArea\AccountArea::registerForm(MyForm::class);