The config file

The installer publishes config/admin.php with the most common keys. Every other key described on this page has a package default, add it to config/admin.php only when you want to change it. Values from config/admin.php always win over the package defaults.

Config cache

php artisan optimize and config:cache work with CrudAdmin, the packages are not merged again on top of a cached config. See Deployment.
  • Config files do not support closures (function () {}, fn () =>), config:cache fails on them. Where a value has to be resolved per request, use a [Class::class, 'method'] callable of a static method; the logo, the groups of a package and admin_helpers.auth.otp.user accept it.
  • Call env() only in config files. With a cached config env() returns null everywhere else, read the value through config().
  • php artisan admin:upgrade:cache of crudadmin/upgrade lists the closures in config files and the env() calls outside them.

Basic settings

Administration name

Shown in the page title, and used as a text logo when no logo is set.
config/admin.php

Module groups

With a larger number of admin models it helps to group the modules. Groups, their names, icons and the order of the whole menu are declared in the navigation section of bootstrap/admin.php, not in config/admin.php.
Administration menu with grouped modules
The groups config key of older versions is moved there by php artisan admin:upgrade:navigation. Packages still merge their groups into config('admin.groups'); such a group is used when the navigation section does not name it, and a group key without any definition is displayed as its key.

Branding

config/admin.php
Without appearance.dashboard, resources/views/admin/dashboard.blade.php is rendered when it exists. Registering Vue components from your scripts is described in Vue app.

License key

config/admin.php
See License.

Authentication

Login

config/admin.php

Application namespace

Root namespace and class name of the admin auth model, used by admin:install and when resolving the auth model. Where models are loaded from is set by models.
config/admin.php

Administrator roles

Enables user groups with permissions per module, see Permissions.
config/admin.php
Admin::isRolesEnabled() returns the value of the key. Without roles every administrator has full access.

Localization

Language versions and Gettext are configured with the localization and gettext groups, and with locale. See Localization.

Models and components

Model and module directories

Admin models are discovered in App, App\Model, App\Models and App\Eloquent. Global model modules are loaded from app/Admin/Modules and applied to every model.
config/admin.php
Directories are scanned recursively, except app_path() itself.

Vue component directory

Components for fields, buttons, columns and layouts are loaded recursively from the listed directories. Relative paths are resolved from the project root, and the package components directory is always added.
config/admin.php
A component can be referenced in several ways: Buttons also look into resources/views/admin/components/buttons, layouts into .../layouts and field components into .../fields. For a comma separated list of field components, every existing component is loaded and missing ones are skipped.
The <style> block of a component is dropped. Put component CSS into a global stylesheet, see branding.

Field rule aliases

custom_rules expands a field parameter into other parameters, global_rules adds parameters to every field of a type. Application values override the package ones.
config/admin.php
Parameters of an alias override parameters written on the field, while parameters written on the field win over global_rules.

Default form autocomplete

Default autocomplete attribute of form inputs in all models, off by default. A model can change it with the form.autocomplete setting.
config/admin.php

Uploads and images

Uploads disk

config/admin.php
Admin::getUploadsStorage() returns the uploads disk, Admin::getUploadsStorage(true) the private uploads disk.

Disk space

Files of deleted records and files replaced by a new upload are deleted from the disk. Set false to keep them. A model can keep its files with $deleteFiles = false.
config/admin.php

Upload filenames

Files with the same name get -1, -2 suffixes. With the postfix enabled, a random suffix is added instead, which avoids existence checks on remote disks.
config/admin.php

Images

config/admin.php
Models can override every value, see image compression. Lossless compression uses spatie/image-optimizer with every optimizer available on the server:

WebP copies

Every resized image also gets a .webp copy stored next to it.
config/admin.php

Resized images

config/admin.php

Change history

Enables the change history. Models record their field changes only with $history = true.
config/admin.php
After enabling history, run php artisan admin:migrate.
Admin::isHistoryEnabled() returns the state of the switch.

Editor

File browser

File browser of the editor field.
config/admin.php
  • lfm requires composer require unisharp/laravel-filemanager.
  • ckfinder is a commercial package downloaded by php artisan editor:ckfinder:download, licensed per hostname. The license is never sent to the browser.
Use only the filemanager array. Old boolean settings were removed in v6; see the upgrade guide.

Optional modules

Frontend editor

Available with the crudadmin/website package (composer require crudadmin/website).
Lets administrators edit static texts, images and links directly on the website. Editable images and links are rendered with the uploadable() and linkable() helpers. See Frontend editor.
config/admin.php

Site tree

Available with the crudadmin/website package (composer require crudadmin/website).
Enables the site tree module, where administrators build the website navigation from routes and model records. See Site tree.
config/admin.php

Slug history and SEO

Slug history (history.sluggable) and SEO of routes (the seo group, available with crudadmin/website) are described in Pretty URLs and SEO.

REST API

Requests to the REST API of the crudadmin/api package are logged by default. max_per_page limits the per_page parameter of the rows list.
config/admin.php

Localized routes

Register localized routes with localizedRoutes(). The unused routes config key was removed in v6.