A signed in administrator sees a floating button on the website. It links to the administration and turns on the Edit mode. In the edit mode, texts, images, files and links of the page get a pencil and are edited in place.

Enabling the editor

config/admin.php
'frontend_editor' => true works as well. Run php artisan admin:migrate. It creates the table of the static content, which stores the edited images and links. Add the @gettext directive to your layout. It loads the editor for administrators with access:
resources/views/layouts/app.blade.php

What can be edited

A text used more than once on a page can not be edited in place. Change it in the translations of the administration.

Images and files

  • On the first render, the default asset is copied into the uploads and compressed. When the default asset changes, the copy is replaced.
  • Without the editor, asset() of the default is returned, without resizing.
  • @uploadable(...) is the Blade form of the helper.
  • Uploaded files other than images are validated by storage.allowed_extensions.
The stored url is saved per language. Urls of the same domain are stored as relative paths.

Editor fields

editor and longeditor fields of a model are wrapped in an editable element on the website. Administrators with the update permission of the model edit them in place. Localized fields save the value of the current language.

Permissions

Saving requires a verified login. When two-factor verification is enabled, the administrator has to complete it first.

Separate frontend

For a frontend on another domain, e.g. Nuxt, enable the stateless mode and set the url of the frontend:
config/admin.php
.env
The stateless editor signs the administrator in with a Sanctum token, so the api needs the personal_access_tokens table. Run php artisan migrate; without it the editor link ends in an error instead of opening the website. The Editor mode dropdown of the administration then offers Webový editor, which opens {WEB_URL}/?admin_token=… in a new tab. On a Nuxt frontend, do not write this by hand. The @crudadmin/helpers layer ships the whole handshake as the auto-imported installEditor(); call it once when the app mounts:
app/app.vue
It reads admin_token from the url, stores it in localStorage (ca_admin_token) and strips the query string, so the editor survives navigation and reloads. Then it calls GET /admin/api/frontend-editor/initialize with Authorization: Bearer {admin_token}, puts the answer into window.CAEditorConfig and injects the returned scripts and styles. The layer has to be extended for the composable to be available:
nuxt.config.ts
The endpoints are not under api/, so config/cors.php has to let the frontend origin reach admin/* and vendor/*. A frontend built with something else repeats the same handshake on its own. The token is valid only for the frontend editor, not for the administration or the REST API. The edit mode is stored in the browser.

Facades