Mainstay GitHub

Plugins

Add types, blocks and screens from a package

A plugin brings content types, blocks, field types, admin screens, listeners and AI providers. It loads only when your config names it, so installing one switches nothing on.

No plugins are published yet. The cards below are examples of what a plugin can add, under a placeholder vendor name.

SEO

acme/seo

Redirects and site-wide SEO settings on a screen of its own, and a cache purge whenever something is published.

Content types Admin screens Listeners
Example

Forms

acme/forms

A form block editors place on any page, and a screen in the admin to read what visitors sent.

Blocks Content types Admin screens
Example

Search index

acme/search-index

Keeps an external search index in step by listening to Saved, Published, Deleted and Restored.

Listeners
Example

CDN purge

acme/cdn-purge

Clears cached pages at a CDN when an entry is published, from a queued listener, so a failure never fails the save.

Listeners
Example

Map field

acme/map-field

A field type for a point on a map, drawn in the form by a view of its own.

Field types
Example

Video embeds

acme/embeds

A block for embedding video, its poster picked from the media library.

Blocks
Example

Audit log

acme/audit-log

Records what changed and when, on a screen behind a capability of its own in the roles grid.

Listeners Admin screens
Example

Together AI

acme/together

Adds Together AI to the Connectors screen, through laravel/ai's OpenAI-compatible driver.

AI providers
Example

Build a plugin

Extend Mainstay\Plugin, give it a handle, and return the types, views, routes, listeners and AI providers the package brings.

The handle reserves your names

Views under seo::, screens under /admin/seo, and the capability use_seo, which the roles grid lists under Plugins.

Named in config to load

Add the class to plugins in config/mainstay.php. A handle another plugin or the admin already has is refused as Mainstay boots.

src/Seo.php
#[Icon('star')]
class Seo extends Plugin
{
    public static function handle(): string
    {
        return 'seo';
    }

    public function views(): ?string
    {
        return __DIR__.'/../resources/views';
    }

    public function routes(): ?string
    {
        return __DIR__.'/../routes/admin.php';
    }
}