Laravel backend
Headless Laravel content store and REST API for Nexus CMS.
The nexus-cms/laravel package is the headless backend: a content store, the
REST API the Next.js client talks to, edit-mode token minting, versions, and
the force-update webhook.
It has no Filament dependency. Drop it into any Laravel app and wire your own auth for minting editor tokens.
Migration:
nexus-cms/filamentis deprecated — usenexus-cms/laravel.
Install
composer require nexus-cms/laravel
php artisan vendor:publish --tag="nexus-cms-migrations"
php artisan migrate
php artisan vendor:publish --tag="nexus-cms-config"The service provider auto-registers. Import the schema produced by
nexus generate:
php artisan nexus:import-schema .nexus/cms-schema.jsonREST API
Mounted at config('nexus-cms.route_prefix') (default api/nexus):
| Method | Path | Purpose |
|---|---|---|
| GET | /schema | The schema |
| GET | /content/{page} | Content document (published, or draft with a Nexus token) |
| POST | /tokens | Mint edit-mode token (host-app auth) |
| PUT | /content/{page}/override | Save one region override |
| DELETE | /content/{page}/override?regionId= | Revert one region to code default |
| PUT | /content/{page}/overrides | Replace the full override map |
| PUT | /content/{page}/seo | Save draft SEO (title, ogImage, …) |
| POST | /content/{page}/publish | Publish + snapshot + force-update |
| GET | /content/{page}/versions | History |
| POST | /content/{page}/versions/{id}/restore | Roll back (?publish=0 = draft only) |
| POST | /media | Upload an image (OG images use this too) |
{page} is the encoded route: / → _root, /a/b → a~b.
Open the editor
Mint a short-lived Nexus token with your host auth (Sanctum by default):
curl -X POST "$API/api/nexus/tokens" \
-H "Authorization: Bearer $HOST_TOKEN" \
-H "Content-Type: application/json" \
-d '{"page":"/"}'Send the user to the returned editUrl, or pass "redirect": true for a
browser redirect. Configure mint middleware with NEXUS_TOKEN_MIDDLEWARE
(default auth:sanctum).
Visual editing happens in the in-context overlay on the frontend — this package only stores content and issues tokens.