Nexus CMS

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/filament is deprecated — use nexus-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.json

REST API

Mounted at config('nexus-cms.route_prefix') (default api/nexus):

MethodPathPurpose
GET/schemaThe schema
GET/content/{page}Content document (published, or draft with a Nexus token)
POST/tokensMint edit-mode token (host-app auth)
PUT/content/{page}/overrideSave one region override
DELETE/content/{page}/override?regionId=Revert one region to code default
PUT/content/{page}/overridesReplace the full override map
PUT/content/{page}/seoSave draft SEO (title, ogImage, …)
POST/content/{page}/publishPublish + snapshot + force-update
GET/content/{page}/versionsHistory
POST/content/{page}/versions/{id}/restoreRoll back (?publish=0 = draft only)
POST/mediaUpload an image (OG images use this too)

{page} is the encoded route: /_root, /a/ba~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.

On this page