Configuration
Anvil is configured in app/Config/Anvil.php, a class that extends
Anvil\Config\Anvil (created by php spark anvil:install, see
Installation). Only set what differs from the
defaults:
namespace Config;
use Anvil\Config\Anvil as BaseAnvil;
class Anvil extends BaseAnvil{ public array $panels = [\App\Panels\AdminPanel::class];
public ?string $holidayProvider = \Anvil\Calendar\GermanHolidays::class; public ?string $holidayRegion = 'BY';
public int $exportSyncLimit = 500;}Library code and packages read the configuration with
Anvil\Config\Anvil::resolve(), which returns the application’s class if
there is one. Panels themselves (brand, colour, navigation, access) are
configured in their classes, see Panels.
Topics
Section titled “Topics”| Topic | Options | Page |
|---|---|---|
| Panels, assets, component endpoint | $panels, $assetsPath, $endpointPath, $endpointRateLimit, $componentTokenTtl |
Panels and endpoint |
| Data and tenants | $uuidField, $internalFields, $multiTenancy, $tenantField |
Data and tenancy |
| Roles, permissions, login | $rbac, $shieldGroupFallback, $policies, $permissions, $passwordLogin, $mfaRequired, $sso, $ssoAutoRedirect |
Access and login |
| Audit log and keys | $audit, $audit…, $auditKey, $auditPreviousKeys, $rekeyers |
Audit and keys |
| Uploads and exports | $file…, $clamAvSocket, $export… |
Files and exports |
| Workflows and working days | $workflowBlocks, $workingDays, $holidayProvider, $holidayRegion, $closedDays |
Workflows and calendar |
| Documents | $documentTemplates, $documentBrand, $documentLogo |
Documents |
| API for machine clients | $api… |
API |
| Links to other systems | $links |
Links |
| Values per environment | .env |
Environments |
Settings in .env
Section titled “Settings in .env”Like every CodeIgniter configuration, options can be set in .env with the
prefix anvil. – for values that differ per environment or are secret:
anvil.multiTenancy = falseanvil.fileMaxSize = 26214400anvil.auditKey = base64:…anvil.sso.adfs.clientSecret = …Values from .env override the class. Elements of arrays are addressed
with dots (anvil.sso.adfs.clientSecret); whole lists (e.g.
$workingDays) are set in the class. See
Environments.
Related configuration
Section titled “Related configuration”- Content Security Policy:
app/Config/ContentSecurityPolicy.php, see Theming and CSP. - Queue:
app/Config/Queue.phpof codeigniter4/queue; Anvil registers its job handler itself. - Shield:
app/Config/Auth.php, e.g. the minimum password length. - Texts: Anvil’s language files can be overridden per key in
app/Language/{locale}/Anvil.php, see Extending Anvil. - Commands: setup, operation and generators, see Commands.