Installation and updates

Migrations

Encrypting existing values

Adding encrypted to a field with stored data leaves the existing rows as plain text. Run the command after admin:migrate to encrypt them:
  • --dry-run counts the rows with plain values per table, nothing is written.
  • --model accepts a table, a full class name or a class name without namespace, and can be repeated. Without it, every admin model with an encrypted field is processed.
  • --chunk sets how many rows are loaded at once, 500 by default.
Values that are already encrypted are skipped, so the command can be run again. Search hashes of the encrypted fields are filled in _encrypted_hashes too. The values are written straight into the table: model events, rules, history and updated_at are not touched. Back up the database first, a value encrypted with a wrong APP_KEY can not be read back.

Model settings migration

Move supported literal UI settings from application models into the editor map:
The command handles $settings, straight-line settings() methods and setSettingsProperty() mutators. It normalizes title aliases, converts legacy before/after ordering to a visibility and order snapshot, and removes only successfully migrated entries. Existing map overrides take precedence. Run it in a development working tree, review the diff and commit both the model edits and app/Admin/model-settings.php. Dynamic expressions and conditional methods are reported and left unchanged for manual migration. The command rewrites only registered models whose source files are inside the application’s app/ directory; it does not rewrite installed or linked package sources. --model accepts a full class name or an admin table and can be repeated. --dry-run reports prospective changes without writing files. Production execution is refused.

Performance cache

Without the cache every request scans the model directories, constructs each model and builds its fields and relations. Packages register their models one by one while service providers boot, so this work is repeated several times per request. With the cache the whole models set is known from the very first moment and regular requests build nothing. admin:cache boots the application in a fresh process, registers all models exactly as a request does and constructs them repeatedly until no new model appears. Compiled base fields and relations are used on frontend and API requests only. The administration, migrations and fields of a given row (getFields($row)) are always built at runtime, because they depend on the logged administrator or on the row itself. The cache is part of php artisan optimize and optimize:clear, admin:migrate refreshes it when it exists, and admin:update compiles it in production or with APP_DEBUG=false. In debug mode a change of any model directory disables the compiled file until it is compiled again.
Compiled fields are bound to the default language and to translations of field names. Run admin:cache after changing the default language or the translations of name, title and placeholder attributes.

Generators

Subdirectories in the name become namespaces, e.g. admin:button Orders/SendInvoice creates App\Admin\Buttons\Orders\SendInvoice. Existing files are never overwritten.

Maintenance

Pre-resize images

  • Choose a model, a file field, and the target width and height. Leave one dimension blank to preserve the aspect ratio; two dimensions crop to fit.
  • Reads the field’s configured storage, including subdirectories, and prepares images in the standard resize cache immediately. Existing cached sizes are reused; originals are unchanged.
  • Processes JPG, JPEG, PNG, GIF, BMP and WebP files. Other files, including SVG, are skipped.
  • Prints a summary of ready, skipped and failed images. A failed image does not stop the remaining files; any failures produce a nonzero exit code.