Publish the config file with:
php artisan vendor:publish --tag=layup-config
This creates config/layup.php. Below is every configuration option.
Map: which key for which job
The defaults work out of the box. Most installations only touch a handful of keys. Use this map to jump to the section you need.
| If you want to... | Section |
|---|---|
| Curate which widgets editors can use | Widgets, Widget auto-discovery |
| Change where uploads go (S3, local, etc.) | Uploads |
| Use a custom Page model or table | Pages and Swapping the Page model |
| Disable the bundled Pages resource | Pages (enabled => false) and Disable the Pages resource |
| Change the URL prefix or middleware for frontend pages | Frontend |
| Change the layout component pages render in | Frontend (layout) |
| Adjust auto-save / revision retention | Revisions |
| Tune scheduled-publishing behavior | Scheduling |
| Change the Tailwind safelist file path | Safelist |
| Change responsive breakpoint widths | Breakpoints |
| Add or remove preset row layouts in the editor | Row templates |
Widgets
'widgets' => [
\Crumbls\Layup\View\TextWidget::class,
\Crumbls\Layup\View\HeadingWidget::class,
// ... 95+ built-in widget classes
],
The full list of registered widgets. Remove entries to disable specific widgets, or add your own classes.
Widget auto-discovery
'widget_discovery' => [
'namespace' => 'App\\Layup\\Widgets',
'directory' => null, // defaults to app_path('Layup/Widgets')
],
Layup automatically discovers widget classes in this namespace. Any class extending BaseWidget found here is registered without needing to add it to the widgets array.
Uploads
'uploads' => [
'disk' => 'public',
],
The filesystem disk used for media uploads (images, files). Must be publicly accessible.
Pages
'pages' => [
'table' => 'layup_pages',
'model' => \Crumbls\Layup\Models\Page::class,
'enabled' => true,
'default_slug' => null,
'max_depth' => 10,
],
- table -- database table name for pages. Change this if you need multiple Layup instances with separate tables.
- model -- the Eloquent model class. Extend
Pageand point here to add custom behavior. - enabled -- whether the Pages resource is registered in the Filament admin panel. Set to
falsewhen you're using Layup purely as a rendering engine (e.g. attachingHasLayupContentto your own models and managing content through your own Filament resources). Disabling the resource does not affect frontend rendering or the database -- it only removes the admin UI. Pages already in the database still render normally via the frontend controller or@layupdirective. - default_slug -- if set, this slug is served when the frontend prefix is hit without a slug.
- max_depth -- maximum depth for parent → child page chains. Top-level pages count as depth 1. Used by the nested-path resolver and as a backstop against accidental cycles when walking ancestors.
Scheduling
'scheduling' => [
'auto_publish' => true,
],
- auto_publish -- when
true(the default), Layup registerslayup:publish-scheduledon the application scheduler to run every minute. Pages withstatus = 'scheduled'flip topublishedonce theirpublished_attime arrives. Set tofalseif you'd rather wire the command yourself (for example, on a single dedicated worker).
Revisions
'revisions' => [
'enabled' => true,
'max' => 50,
],
- enabled -- toggle automatic revision creation on page save
- max -- maximum revisions to keep per page. Older revisions are pruned automatically.
Frontend
'frontend' => [
'enabled' => true,
'prefix' => 'pages',
'middleware' => ['web'],
'domain' => null,
'layout' => 'app',
'view' => 'layup::frontend.page',
'max_width' => 'container',
'include_scripts' => true,
'excluded_paths' => [],
],
- enabled -- register frontend routes for serving published pages
- prefix -- URL prefix. Use
'pages'for/pages/about, or''(or'/') to mount at the site root. An empty/slash prefix activates auto-exclusion of Filament panel paths, Livewire, and other framework routes; other values (includingnull) skip that safeguard. See Frontend Rendering > Serving pages at the site root. - middleware -- middleware applied to frontend routes
- domain -- restrict routes to a specific domain
- layout -- Blade component name passed to
<x-dynamic-component>. Example values:'app'→resources/views/components/app.blade.php'layouts.app'→resources/views/components/layouts/app.blade.php'layouts::app'→resources/views/layouts/app.blade.php(Livewire anonymous namespace — use this with the Livewire starter kit)
- view -- Blade view for rendering pages
- max_width -- CSS class for page container width
- include_scripts -- include Alpine.js animation scripts in frontend
- excluded_paths -- additional paths to exclude from the root-mount catch-all (only applied when
prefixis''or'/')
Safelist
'safelist' => [
'enabled' => true,
'auto_sync' => true,
'path' => 'storage/layup-safelist.txt',
'extra_classes' => [],
],
- enabled -- toggle safelist generation
- auto_sync -- regenerate the safelist file automatically on page save/delete
- path -- output path for the safelist file (relative to project root)
- extra_classes -- additional CSS classes to always include in the safelist
Breakpoints
'breakpoints' => [
'sm' => ['label' => 'sm', 'width' => 640, 'icon' => 'heroicon-o-device-phone-mobile'],
'md' => ['label' => 'md', 'width' => 768, 'icon' => 'heroicon-o-device-tablet'],
'lg' => ['label' => 'lg', 'width' => 1024, 'icon' => 'heroicon-o-computer-desktop'],
'xl' => ['label' => 'xl', 'width' => 1280, 'icon' => 'heroicon-o-tv'],
],
'default_breakpoint' => 'lg',
Defines the responsive breakpoints available in the builder's preview toolbar and the SpanPicker. The default_breakpoint sets which view is shown by default when editing.
Row templates
'row_templates' => [
[12],
[6, 6],
[4, 4, 4],
[3, 3, 3, 3],
[8, 4],
[4, 8],
[3, 6, 3],
[2, 8, 2],
],
Predefined column layouts shown when adding a new row. Each array represents column spans that should sum to 12. Add custom layouts here.
Contributors
Thank you to everyone who has contributed to this package. Every pull request, bug report, and idea makes a difference.