Installation:
composer require firefly/filament-blog
php artisan filament-blog:install
php artisan migrate
php artisan storage:link
fblog_ prefix.Integrate with Filament Panel: Add the plugin to your Filament panel provider:
public function panel(Panel $panel): Panel {
return $panel->plugins([
Blog::make(),
]);
}
First Blog Post:
/admin).View Live:
/blogs (or your configured route prefix) to see the blog post in action.config/filamentblog.php – Customize routes, SEO, recaptcha, and table prefixes.resources/views/vendor/filament-blog (customize via vendor:publish).database/migrations/ for table structures (e.g., posts, categories).filamentblog.php under seo.meta./blogs.Create/Edit Posts: Use Filament’s Posts resource to draft, schedule, or publish posts. The editor supports:
Workflow Example:
graph LR
A[Draft Post] -->|Save| B[Scheduled/Published]
B -->|Edit| A
B -->|Trash| C[Deleted]
Scheduled Posts:
Set published_at in the future to auto-publish. The plugin handles this via Laravel’s queue system.
// In Post resource's EditForm
use Firefly\FilamentBlog\Forms\Components\SEOMeta;
SEOMeta::make()
->title('Custom Title')
->description('Custom description for this post.')
sitemap package to include blog posts in XML sitemaps:
Sitemap::add(Post::query()->where('published_at', '<=', now()));
php artisan vendor:publish --tag=filament-blog-views
@include('filament-blog::comments.form')
@include('filament-blog::comments.list')
canComment() in your User model (see README).Subscribe component:
use Firefly\FilamentBlog\Widgets\Subscribe;
Subscribe::make()
->listener(function ($email) {
// Add to Mailchimp/Newsletter service
});
norouzimohammadreza/multilingual package alongside Filament Blog:
composer require norouzimohammadreza/multilingual
filamentblog.php:
'locales' => ['en', 'es', 'fr'],
php artisan vendor:publish --tag=filament-blog-views
Key files to customize:
resources/views/vendor/filament-blog/layouts/app.blade.php (main layout).resources/views/vendor/filament-blog/posts/show.blade.php (single post).Post model or use Filament’s custom fields:
use Filament\Forms\Components\Select;
Select::make('custom_field')
->options(['option1', 'option2'])
->afterStateUpdated(fn ($state, $set) => $set('custom_field', $state));
Route::get('/api/posts', function () {
return Post::with(['author', 'categories'])->get();
});
php artisan make:filament-resource Post --api
<x-filament-media-library-picker :model="$post" field="image" />
use Filament\Notifications\Notification;
Notification::make()
->title('New Blog Post')
->body('Check out the latest post!')
->send();
use Firefly\FilamentBlog\Widgets\RecentPosts;
RecentPosts::make()->height('300px');
Post::addGlobalScope(new \Laravel\Scout\Builder);
use Spatie\MediaLibrary\HasMedia;
class Post extends Model implements HasMedia
{
use HasMedia;
}
Echo.channel('blog-updates')
.listen('PostPublished', (e) => {
// Update UI
});
Table Prefix Conflicts:
tables.prefix in filamentblog.php after initial migration, run:
php artisan filament-blog:upgrade-tables
Recaptcha Misconfiguration:
recaptcha.enabled is true but keys are missing in .env, the comment form will fail silently..env:
RECAPTCHA_SITE_KEY=your_site_key
RECAPTCHA_SECRET_KEY=your_secret_key
Storage Permissions:
storage:link isn’t run or permissions are incorrect.chmod -R 775 storage/app/public
php artisan storage:link
Rich Editor Issues:
php artisan vendor:publish --tag=filament-blog-views
php artisan optimize:clear
SEO Meta Overrides:
filamentblog.php apply globally. To override per post, use Filament’s SEO Meta Extension in the resource.Comment Spam:
spatie/laravel-honeypot for protection.Filament Version Mismatch:
composer.json for Filament constraints.How can I help you explore Laravel packages today?