aw codes icon logo
Docs Hub

Search across every project.

Mason Switch project

A simple block based drag and drop page / document builder field for Filament.

3.x Current

On this page

Configuration

Publish the config file with:

php artisan vendor:publish --tag="mason-config"
return [
    'generator' => [
        'namespace' => 'App\\Mason',
        'views_path' => 'mason',
    ],
    'preview' => [
        'layout' => 'mason::iframe-preview',
    ],
    'entry' => [
        'layout' => 'mason::iframe-entry',
    ],
    'routes' => [
        'middleware' => ['web', 'auth'],
    ],
];
Key Purpose
generator.namespace Namespace make:mason-brick writes brick classes into.
generator.views_path Directory under resources/views for generated brick templates.
preview.layout Default preview layout for the Mason field.
entry.layout Default preview layout for MasonEntry.
routes.middleware Middleware applied to Mason's internal routes.

Both layout defaults can be overridden per field with previewLayout() — see Form field.

Auth guards

Mason's internal routes run through the web and auth middleware. If your panel uses a different guard, adjust the middleware so those routes authenticate against it:

'routes' => [
    'middleware' => ['web', 'auth:admin'],
],