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
composer require afea/filament-pages
php artisan afea:install:pagesThen in your AdminPanelProvider:
->plugin(\Afea\Cms\Pages\Filament\PagesPlugin::make())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 injectedSet AFEA_PAGES_ROUTING_STRATEGY=resource + AFEA_PAGES_PREFIX=pages — URLs move from /about to /pages/about. No data changes.
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],php artisan vendor:publish --tag=afea-pages-viewsEdit resources/views/vendor/afea-pages/show.blade.php. The template receives $page, $seo, $content (with TOC ids already injected) and $toc (nested array).