afea / filament-pages
Custom pages module for the Afea Filament CMS package ecosystem: rich CMS pages with optional table of contents and polymorphic form attachment.
v0.1.0
2026-04-21 10:48 UTC
Requires
- php: ^8.4
- afea/filament-cms-core: @dev
- filament/filament: ^4.0
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/support: ^12.0
- laravel/prompts: ^0.3
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
README
Custom pages module for the Afea Filament CMS package ecosystem.
Ships:
CustomPagemodel — rich content, SEO, optional table of contents, attachable form- Filament v4
CustomPageResource(form + table + pages) PagesPlugin— register in yourAdminPanelProvider- Public-facing routes registered per the configured routing strategy (slug / resource / localized)
PageController+ overridable Blade views with sticky TOC sidebarafea:install:pages— Laravel Prompts installer
Installation
composer require afea/filament-pages php artisan afea:install:pages
Then in your AdminPanelProvider:
->plugin(\Afea\Cms\Pages\Filament\PagesPlugin::make())
The table of contents
Each page has an include_toc toggle. Enabling it:
- parses
contentforh2andh3tags, - injects slugged
idattributes onto each heading, - renders a nested list in the shipped
showview.
Override tags via afea-pages.toc.tags. Build your own UI with:
$toc = $page->toc(); $tree = $toc->tree(); // nested array of id/text/children $html = $toc->html(); // content with ids injected
Three common scenarios
1. Switch routing strategy
Set AFEA_PAGES_ROUTING_STRATEGY=resource + AFEA_PAGES_PREFIX=pages — URLs move from /about to /pages/about. No data changes.
2. Override the CustomPage model
class CustomPage extends \Afea\Cms\Pages\Models\CustomPage { public function scopePublished(Builder $q): Builder { return $q->active()->whereNotNull('system_name'); } }
'models' => ['custom_page' => \App\Models\CustomPage::class],
3. Render your own theme
php artisan vendor:publish --tag=afea-pages-views
Edit resources/views/vendor/afea-pages/show.blade.php. The template receives $page, $seo, $content (with TOC ids already injected) and $toc (nested array).