Every admin model is built from parameters that define how the administration, the database and the forms are generated. A freshly created model already contains the most common ones, which you can edit, remove or extend.
Any parameter that creates a database column, or changes an existing column, requires php artisan admin:migrate. See migrations.

Where parameters are documented

Fields

Fields are returned from the fields() method. The method receives the edited record, so rules can depend on it.
app/Models/Customer.php
$row is null when a record is created, and the edited record when it is updated in the administration, in getValidationRules($row) and in validateRequest() called on a record. Fields resolved for a record do not change the fields returned later without a record. The complete field reference is in Fields.

Basic parameters

Module name

The name of the module in the sidebar, in the module header and in the change history.
app/Models/Article.php
Use a literal gettext source message; Laravel translation keys are no longer resolved.
When the name depends on runtime state, leave the property empty and define a name() method instead.
Module name in the administration sidebar
$this->name inside the model returns this property, not the name column. Use $this->getAttribute('name') in model methods when the table has a name column. The same applies to $title.

Module description

Optional description shown under the module name. Literal messages are translated through gettext.
Module description under the section heading

Module icon

Font Awesome icon of the module in the sidebar, the icon setting. The menu editor of crudadmin/admin-editor changes it by a click on the icon and writes it into the models section of bootstrap/admin.php.
bootstrap/admin.php
A model of a package declares it in its own settings, bootstrap/admin.php overrides it like any other setting. An icon which depends on runtime conditions is returned by settings().
Without an icon, well known table names get one automatically, e.g. a table ending with articles gets fa-file-alt, orders gets fa-credit-card. The name is matched by the singular of the last segment of the table name, so articles_categories is matched as category.
Only the solid and the regular Font Awesome sets are bundled with the administration. A brand icon such as fa-wpforms renders nothing.

Disabling the module

Set $active to false to hide the module from the menu. The table is still migrated, and the module offers no permissions in user groups.
The value can be decided on every request with a method:
An inactive module is only hidden. Restrict access with user group permissions when needed.

Dynamic parameters

Callable parameters can be declared as methods. The method wins over the property and is evaluated when the value is needed.
A set{Property}Property() mutator changes the resolved value. It can be declared on the model, in a parent class or in a model module. Model mutators run first, module mutators receive their result.
These parameters are resolved this way: name, group, fields, active, inMenu, single, options, searches, insertable, editable, publishable, deletable, rules, settings, buttons, exports, reserved, layouts and belongsToModel.
Other parameters, for example $displayable or $sortable, are read from the property only. A displayable() or sortable() method is ignored.

Cached queries

Cache small, rarely changed tables (countries, VAT rates, settings) and flush them automatically when a record is saved, deleted or reordered in the administration.
app/Models/Country.php
Keys are stored as models.{table}.{key}. Mass updates through the query builder (Country::query()->update([...])) do not flush the cache.

Replicating records

replicateWithRelations() creates a copy of the record including many to many relations and all records of child models. It is typically used in a button.
app/Admin/Buttons/ReplicateCourse.php
Single files are copied with the cloned_xxxx_ prefix, multiple file fields keep references to the same files. replicate() of admin models skips the _order column, so the copy gets a new position.

Site tree

Available with the crudadmin/website package (composer require crudadmin/website).
With the site tree module enabled, records of a model can be linked in the site tree editor. The value is the label column. Rendering the tree on the website is described in Site tree.
app/Models/Branch.php