afea / filament-blog
Blog module for the Afea Filament CMS package ecosystem: blog posts, categories, tags with SEO, media and polymorphic forms.
v0.1.0
2026-04-21 10:48 UTC
Requires
- php: ^8.4
- afea/filament-cms-core: @dev
- filament/filament: ^4.0
- filament/spatie-laravel-media-library-plugin: ^4.0
- illuminate/contracts: ^12.0
- illuminate/database: ^12.0
- illuminate/support: ^12.0
- laravel/prompts: ^0.3
- spatie/laravel-medialibrary: ^11.0
Requires (Dev)
- laravel/pint: ^1.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
README
Blog module for the Afea Filament CMS package ecosystem.
Ships:
BlogPost,Category,Tagmodels (SEO + polymorphic forms + media thumbnail via Spatie)- Filament v4 resources for each model
BlogPlugin— register in yourAdminPanelProviderto mount the resources- Public-facing routes registered per the configured routing strategy (slug / resource / localized)
BlogController+ overridable Blade viewsafea:install:blog— Laravel Prompts installer
Installation
composer require afea/filament-blog php artisan afea:install:blog
Then in your AdminPanelProvider:
->plugin(\Afea\Cms\Blog\Filament\BlogPlugin::make())
Config highlights
return [ 'models' => [ 'blog_post' => \Afea\Cms\Blog\Models\BlogPost::class, 'category' => \Afea\Cms\Blog\Models\Category::class, 'tag' => \Afea\Cms\Blog\Models\Tag::class, ], 'user_model' => \App\Models\User::class, 'routing_strategy' => env('AFEA_BLOG_ROUTING_STRATEGY', 'resource'), 'prefix' => env('AFEA_BLOG_PREFIX', 'blog'), 'views' => [ 'index' => 'afea-blog::index', 'show' => 'afea-blog::show', ], 'media' => [ 'disk' => env('AFEA_BLOG_MEDIA_DISK', null), 'thumbnail_collection' => 'blog-posts/thumbnails', 'preview_size' => [300, 300], ], ];
Three common scenarios
1. Switch routing strategy without re-installing
Set AFEA_BLOG_ROUTING_STRATEGY=slug in .env and your posts now live at /{slug}. No migrations, no code changes.
2. Override the BlogPost model
// app/Models/BlogPost.php namespace App\Models; class BlogPost extends \Afea\Cms\Blog\Models\BlogPost { public function scopeFeatured($query) { return $query->where('is_active', true)->whereNotNull('published_at'); } }
// config/afea-blog.php 'models' => ['blog_post' => \App\Models\BlogPost::class],
3. Use your own Blade theme
php artisan vendor:publish --tag=afea-blog-views
Edit resources/views/vendor/afea-blog/show.blade.php freely. Point afea-blog.views.* at your own templates for more control.