Mainstay GitHub

Documentation

Mainstay documentation

How to model content in PHP, edit it in the admin and serve it from your Laravel application. Start with the installation guide.

terminal
composer require mainstay/cms
php artisan vendor:publish --tag=mainstay-assets
php artisan migrate
php artisan mainstay:user [email protected] --role=administrator

Guides

Written against the current main branch.

Getting started

Install the package, declare a first type and sign in to the admin.

Content

Fields, rich text and blocks, images, and the languages a field is written in.

Relations

Entries that point at each other, tags, and globals for what every page shares.

Rendering

Routes and templates, the query layer, and the blocks your views draw.

Editing

The page builder, drafts and revisions, and who may do what.

Extending

The content API and MCP server, plugins, and AI connectors.

Artisan commands

The ones you will run most, each after php artisan.

mainstay:user [email protected] --role=administrator Make an account on the server. The first one can only be made this way. server
mainstay:sync Alter the database to match the declared types. Off unless MAINSTAY_SCHEMA_SYNC=true, and it refuses to run in production. development
mainstay:schema:check Compare the database with the declared types, and fail when they differ. CI
mainstay:media:reprocess Queue every copy of an image its fields declare and that is not written yet. new sizes
mainstay:token [email protected] "CI build" --capability=edit_articles Make an API token for an account, holding the capabilities named. server
mainstay:typescript Write the content API's payloads out as TypeScript declarations. front end
vendor:publish --tag=mainstay-config Publish the config: the admin's and the API's paths, their middleware, a domain and the locales. once

Beyond the guides