351 results
Sorted by relevance
Developer Documentation / Resource Lists
How do I add a custom column to the order list?
As the orders list is a resource list you can add a custom column like this:
More information on resource lists can be found in the article "How do I extend an existing Resource List?
<?php
namespace Acme\MyModule;
use Aero\Admin\ResourceLists\OrdersResourceLi...
Developer Documentation / Response Builders
How do I access the properties of the response builder?
All response builders hold properties that were assigned to them upon creation from the request. These properties are typically the arguments that would be passed to a conventional Laravel controller and subsequently used in the code within the controller.
For...
Developer Documentation / Response Builders
How do I pass data to a response?
The most common task performed when extending responses, is setting additional data. Typically, for HTML responses that render from a view, this involves sending data to the view to be used as a variable. If the response returns JSON, it may be adding addition...
Developer Documentation / Response Builders
How do I redirect a response?
Sometimes you may wish to redirect the user to another location, either to an external site or within the store. To do so, pass the URL, route(), or an Illuminate\Http\RedirectResponseinstance to the **setRedirect()**method. For example, if you stored the age ...
Developer Documentation / Response Builders
How do I set the response status code?
There may be situations where the HTTP response status needs to be altered. By default, the returned status is 200, however, this can be changed by passing the new status code to the **setStatus()**method:
\Aero\Store\Http\Responses\ProductPage::extend(functio...
Developer Documentation / Response Builders
How do I set response headers?
When extending the response builder, you can set HTTP headers to be sent with the response:
\Aero\Store\Http\Responses\ProductPage::extend(function ($page) {
$page->setHeader('foo', 'bar');
});
Developer Documentation / Response Builders
How do I attach middlewear to a response builder?
Since Aero does not expose the underlying routes and controllers, middleware can be attached directly to the response builder. This allows for code to be executed before the main pipeline is run.
For example, to restrict all products from being accessible to g...
Developer Documentation / Response Builders
How do I extend responses?
Adding additional code to run on the response is as simple as calling the **extend()**method on the response builder class. This is typically done from within a Service Provider. If the code is unique to a particular store it could be placed in the boot method...
Developer Documentation / Response Builders
How do I change the response view?
For responses that return HTML, a Twig view file is used. Whilst these are originally defined, the view can be changed. For example, to change the product page view based on product data:
\Aero\Store\Http\Responses\ProductPage::extend(function ($page) {
if...
Developer Documentation / Response Builders
What are the available responses from the response builder?
Core
Class
Description
View
Homepage
The homepage of the store.
homepage.twig
ProductPage
The product page providing information on a particular product.
product.twig
ListingsPage
The listings page which displays available products for the particular criteria ...
Developer Documentation / Settings
What are the settings available to developers?
Settings allow you to add dynamic values to your modules that can be modified by admin users easily through the admin.
The values of your settings (unless the value is the default you set) are stored in json files inside of your storage directory.
└─ storage
...
Developer Documentation / Settings
Do do I set the default value of my custom setting?
You can add a default value to any setting by using the defaultmethod and passing your default value.
<?php
namespace Acme\MyModule;
use Aero\Common\Facades\Settings;
use Aero\Common\Providers\ModuleServiceProvider;
use Aero\Common\Settings\SettingGroup;
class...
Developer Documentation / Settings
How do I register custom settings?
To register settings you need to use the Aero\Common\Facades\Settingsfacade from the setupmethod of your modules service provider. You should call the groupmethod on the facade and pass in a unique name for your settings group and a closure that defines your s...
Developer Documentation / Settings
How do I access a custom setting?
You can access a setting by using the settingfunction that is available in PHP, Blade, and Twig. You simply need to pass your setting group name, a full stop, and then the settings name.
setting(‘acme-my-module.allow_list’)
Developer Documentation / Settings
What are the available setting types?
Setting
Description
$group->array(‘allow_list’);
Returns an array.
$group->boolean(‘enabled’);
Returns a boolean, true or false.
$group->eloquent('order_status', OrderStatus::class);
Stores the key of the eloquent model you pass and returns an instance of the ...
Developer Documentation / Settings
How do I configure the admin edit page?
By default your setting group is editable through the admin by a generated edit page. You cannot remove this generated edit page but you can stop users from being able to edit the settings using it. It’s important to note that if you disable editing through th...
Developer Documentation / Settings
How do I handle translations?
When defining your setting groups title/summary, or a settings label/hint you can make use of Laravel Localization for translations.
<?php
namespace Acme\MyModule;
use Aero\Common\Facades\Settings;
use Aero\Common\Providers\ModuleServiceProvider;
use Aero\Comm...
Developer Documentation / Settings
How do I add settings to the product model?
Using the same syntax as when you create settings
<?php
namespace Acme\MyModule;
use Aero\Catalog\Models\Product;
use Aero\Common\Providers\ModuleServiceProvider;
use Aero\Common\Settings\SettingGroup;
class ServiceProvider extends ModuleServiceProvider
{
p...