Panels and endpoint
Panels and assets
Section titled “Panels and assets”| Option | Default | Purpose |
|---|---|---|
$panels |
[] |
panel classes; their routes, navigation and components are registered automatically |
$assetsPath |
'assets/anvil' |
public path of the assets published by anvil:publish, relative to the document root |
public array $panels = [\App\Panels\AdminPanel::class, \App\Panels\PortalPanel::class];Panels are registered explicitly; Anvil never scans the file system. Panel ids must be unique. What a panel defines: Panels.
After every update of Anvil, publish the assets again (php spark anvil:publish, also run by the Composer scripts of the starter). Change
$assetsPath only together with the web server configuration; the files
are served with their integrity hashes.
Component endpoint
Section titled “Component endpoint”Lists, forms, actions and searches talk to the component endpoint of their panel.
| Option | Default | Purpose |
|---|---|---|
$endpointPath |
'_anvil' |
URI segment of the endpoint in every panel, e.g. /admin/_anvil |
$endpointRateLimit |
120 |
requests per minute and client IP; 0 switches the limit off |
$componentTokenTtl |
7200 |
lifetime of component tokens in seconds |
- Rate limit: a page with many lists and searches can send several
requests a minute per user. Behind a proxy all users may share one IP –
configure CodeIgniter’s
$proxyIPs, so the real client IP counts, or raise the limit. - Token lifetime: tokens bind a component to the user, tenant and record. A page open longer than the lifetime asks for a reload. Shorter lifetimes are safer, longer ones friendlier to long forms.
- Path: slugs of resources and pages must not collide with it (nor with
_tenant,_file,_export).