nexus-cms / filament
Laravel + Filament backend adapter for Nexus CMS: content store, REST API, edit-mode token handshake, versioning and force-update.
Requires
- php: ^8.1
- filament/filament: ^3.2
- illuminate/contracts: ^10.0 || ^11.0
- illuminate/support: ^10.0 || ^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- orchestra/testbench: ^8.0 || ^9.0
- phpunit/phpunit: ^10.0 || ^11.0
README
Laravel + Filament v3 backend adapter for Nexus CMS.
It is the content store, the REST API the Next.js client talks to, the edit-mode token handshake entry point, and it manages versions and force-update.
Filament is the management layer / access point. Visual editing happens in the in-context overlay on the frontend; this package stores content and lets admins launch the editor and force-publish.
Docs: https://nexus.mkiteg.com/docs
Frontend packages: npm install nexus-cms
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 Filament 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):
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /schema |
public | The cms-schema.json |
| GET | /content/{page} |
public (published) / token (draft) | Content document |
| PUT | /content/{page}/override |
token | Save one region override (live editor) |
| DELETE | /content/{page}/override |
token | Revert one region (?regionId=) |
| PUT | /content/{page}/overrides |
token | Replace full override map |
| PUT | /content/{page}/seo |
token | Save draft SEO (title, ogImage, …) |
| POST | /content/{page}/publish |
token | Publish draft, create version, force-update |
| GET | /content/{page}/versions |
public | Version history |
| GET | /content/{page}/versions/{id} |
public | A version snapshot |
| POST | /content/{page}/versions/{id}/restore |
token | Roll back (?publish=0 = draft only) |
| POST | /media |
token | Upload an image |
| GET | /media |
public | Media library |
{page} is the encoded route: / → _root, /a/b → a~b (matches the
Next.js client).
Handshake + force update
- Open editor (Filament action) →
nexus-cms/editor/{page}mints a short-livedNexusTokenand redirects toFRONTEND_URL/api/nexus/edit?token=…. - Publish / Force update → POSTs to
FRONTEND_URL/api/nexus/revalidatewith the webhook secret so the page is revalidated instantly.
Key env
NEXUS_FRONTEND_URL=https://yoursite.com NEXUS_WEBHOOK_SECRET=change-me NEXUS_SCHEMA_PATH=/path/to/.nexus/cms-schema.json NEXUS_MEDIA_DISK=public
Development
composer install ./vendor/bin/phpunit
Source of this package repo: https://github.com/forged-tools/backend
Private monorepo (full product): https://github.com/forged-tools/cms