Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/layup.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
'pages' => [
'table' => 'layup_pages',
'model' => \Crumbls\Layup\Models\Page::class,
'enabled' => true,
'default_slug' => null,

/*
Expand Down
2 changes: 2 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/LayupPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading