Skip to main content
Slots · Revision #1

How do I inject into account area slots?

How do I inject into account area slots?

Account Area Slots allow you to add content within existing account area pages. The examples below show how to inject a view into the orders page.

For a simple use case, simply provide a view:

\Aero\AccountArea\AccountAreaSlot::inject('order.header.buttons', 'acme::button');

For more advanced use cases, instead of passing a view directly, you can provide a callback function:

\Aero\AccountArea\AccountAreaSlot::inject('order.header.buttons', function ($data) {
    // add custom variables to the $data array

    return view('acme::button', $data);
});

These injections should typically sit inside the boot method of a Service Provider