Nexus CMS

Filament backend

The Laravel/Filament content store and REST API.

The nexus-cms/filament package is the MVP backend: a content store, the REST API the Next.js client talks to, the edit-mode handshake entry point, versions and the force-update webhook.

Install

composer require nexus-cms/filament
php artisan vendor:publish --tag="nexus-cms-migrations"
php artisan migrate
php artisan vendor:publish --tag="nexus-cms-config"

Register the plugin in your panel provider:

use NexusCms\Filament\NexusCmsPlugin;

$panel->plugin(NexusCmsPlugin::make());

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 token)
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.

Management

In Filament you get a Pages resource (open the editor, force update) and a read-only Versions resource (restore any snapshot). The heavy editing happens in the in-context overlay on the frontend; Filament is the management layer and access point.

On this page