Skip to main content
Pages · Revision #1

How do I add a section to an existing account area page?

How do I add a section to an existing account area page?

You can use the addSection() method(s) to add a section to an existing form:

\Aero\AccountArea\Http\Responses\AccountLoginPage::extend(function (\Aero\AccountArea\Http\Responses\AccountLoginPage $page, \Closure $next) {
    // Add it as the first section
    $page->addSection('acme', 'acme::section');

    // Add it after a specific section
    $page->addSectionAfter('acme', 'acme::custom', 'login-form');
  
    // Add it before a specific section
    $page->addSectionBefore('acme', 'acme::custom', 'login-form');
  
    return $next($page);
});

If you need to see the keys of the existing columns in order to position your new column appropriately, you can dump them out:

\Aero\AccountArea\Http\Responses\AccountLoginPage::extend(function (\Aero\AccountArea\Http\Responses\AccountLoginPage $page, \Closure $next) {
    dd($page->getSections()->keys()->toArray());
  
    return $next($page);
});