Laravel Post2Site
Adds authenticated drafts, validation, previews, and confirmed publication through an adapter for your Laravel models.
Laravel developers connecting their own content models to an AI-assisted publishing workflow.

Overview
- The Laravel backend for the N2N Post2Site MCP bridge.
- Handles API keys, staged drafts, validation envelopes, and publish confirmation.
- Your application supplies the adapter, content model, storage mapping, and public pages; installing the package alone does not create a CMS.
Common Uses
- Connect an existing Laravel content model to an MCP authoring workflow.
- Try a create-only text blog in a fresh Laravel app with real preview and published pages.
- Keep content publication behind host-defined validation and an explicit confirmation step.
Requirements
- PHP 8.2+ with Laravel 12, or PHP 8.3+ with Laravel 13.
- A Laravel application with a database.
- A concrete Post2SiteAdapter supplied and bound by the host application.
Install
- 1
composer require n2ns/laravel-post2site
- 2
php artisan vendor:publish --tag=post2site-config
- 3
Implement a Post2SiteAdapter and set post2site.bindings.adapter in config/post2site.php. The first-publish tutorial supplies a complete text-blog example for a fresh app.
- 4
php artisan migrate
- 5
php artisan post2site:key "Production MCP"
Configure
- 1
The package has no default content adapter. Bind your adapter before calling the API.
- 2
In the n2n-post2site MCP server entry, set CONTENT_API_BASE_URL to https://your-site.example/api/v1/mcp and CONTENT_API_KEY to the generated key.
- 3
The bridge sends the key in X-API-KEY by default. Keep it out of prompts and source control.
- 4
Your adapter defines content fields, inventory, duplicate checks, validation, selected assets, preview, and publication.
Tools / Commands
- php artisan post2site:key [name] -- Generate a site-scoped API key.
- php artisan migrate -- Create the package tables using automatically loaded migrations.
Resources / Settings
- Default API prefix: /api/v1/mcp.
- Staged drafts store a host-defined content_payload JSON object.
- The separate simple-blog example includes a model, migration, adapter, signed preview, and public article route.
- Publishing requires explicit publish_confirmed=true and successful publish validation.
FAQ
Frequently asked questions and troubleshooting guides.