From f6ddd9a7b4ced76b60b66168b348bd25324a3a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Sch=C3=A4fer?= Date: Mon, 16 Mar 2026 17:07:52 +0100 Subject: [PATCH 1/2] feat(core): add option to hide layup "pages" resource in filament panel --- config/layup.php | 1 + src/LayupPlugin.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/config/layup.php b/config/layup.php index 566d14e..60b904f 100644 --- a/config/layup.php +++ b/config/layup.php @@ -160,6 +160,7 @@ 'pages' => [ 'table' => 'layup_pages', 'model' => \Crumbls\Layup\Models\Page::class, + 'enabled' => true, 'default_slug' => null, /* diff --git a/src/LayupPlugin.php b/src/LayupPlugin.php index b7050af..ed195a6 100644 --- a/src/LayupPlugin.php +++ b/src/LayupPlugin.php @@ -143,9 +143,11 @@ public function withoutPanelColors(): static public function register(Panel $panel): void { - $panel->resources([ - PageResource::class, - ]); + if (config('layup.pages.enabled', true)) { + $panel->resources([ + PageResource::class, + ]); + } } public function boot(Panel $panel): void From 19618a325ffce69405d494075d1d48b7be33bf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20Sch=C3=A4fer?= Date: Mon, 16 Mar 2026 17:08:17 +0100 Subject: [PATCH 2/2] docs: hide layup "pages" resource in filament panel --- docs/configuration.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 8e5ae4b..4bc7000 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -50,12 +50,14 @@ The filesystem disk used for media uploads (images, files). Must be publicly acc 'pages' => [ 'table' => 'layup_pages', 'model' => \Crumbls\Layup\Models\Page::class, + 'enabled' => true, 'default_slug' => null, ], ``` - **table** -- database table name for pages. Change this if you need multiple Layup instances with separate tables. - **model** -- the Eloquent model class. Extend `Page` and point here to add custom behavior. +- **enabled** -- whether the Pages resource is registered in the Filament admin panel. Set to `false` when you're using Layup purely as a rendering engine (e.g. attaching `HasLayupContent` to 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 `@layup` directive. - **default_slug** -- if set, this slug is served when the frontend prefix is hit without a slug. ## Revisions