kseven / filament-multiblog
Firefly/Filament-Blog plugin extension with site_id support (multi-ban by site).
dev-master
2025-06-23 14:58 UTC
Requires
- php: >=8.1
- filament/filament: ^3.0
- firefly/filament-blog: ^2.0
This package is auto-updated.
Last update: 2025-06-23 14:58:15 UTC
README
Extension for the firefly/filament-blog plugin, adding full support for multiple sites scoped by site_id
.
๐ Installation
composer require kseven/filament-multiblog
Requires: Laravel 11 or 12 + FilamentPHP 3
โ๏ธ Configuration
- Publish the config file:
php artisan vendor:publish --tag=filament-multiblog-config
- Check the
config/multiblog.php
file:
return [ 'enabled' => env('MULTIBLOG_ENABLED', true), 'site_model' => App\Models\Site::class, ];
- (Optional) Add the middleware to
Http\Kernel.php
:
protected $middlewareGroups = [ 'web' => [ // ... \Kseven\FilamentMultiBlog\Http\Middleware\DetectSite::class, ], ];
๐งฉ Features
- ๐ Support for multiple blogs scoped by
site_id
- โ
Fully compatible with all
filament-blog
features - ๐ง Auto-detection middleware via domain
- ๐ ๏ธ Custom Models, Resources, and Notifications scoped per site
- ๐ฌ Automatic new post notification to subscribers per site
- ๐๏ธ Optional configuration for selecting
site_id
๐ Usage
- Make sure your
sites
table exists and is populated. - The system will automatically apply
site_id
to posts and resources. - Use
HasSiteScope
for automatic query scoping:
use Kseven\FilamentMultiBlog\Traits\HasSiteScope; class Post extends BasePost { use HasSiteScope; }
- When creating or editing records in the panel, the
site_id
field will be automatically handled.
๐งช Example Seeders
php artisan db:seed --class=\\Database\\Seeders\\SiteSeeder php artisan db:seed --class=\\Database\\Seeders\\CategorySeeder
๐ Important
- This package does not modify the original plugin directly.
- It only extends Models, Resources, and behaviors using
bind()
in its ownServiceProvider
.
โจ Credits
- The Firefly Tech โ creators of the original plugin
- K'Seven โ maintainer and multi-site extension author
๐ License
MIT