kseven/filament-multiblog

Firefly/Filament-Blog plugin extension with site_id support (multi-ban by site).

dev-master 2025-06-23 14:58 UTC

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

  1. Publish the config file:
php artisan vendor:publish --tag=filament-multiblog-config
  1. Check the config/multiblog.php file:
return [
    'enabled' => env('MULTIBLOG_ENABLED', true),
    'site_model' => App\Models\Site::class,
];
  1. (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

  1. Make sure your sites table exists and is populated.
  2. The system will automatically apply site_id to posts and resources.
  3. Use HasSiteScope for automatic query scoping:
use Kseven\FilamentMultiBlog\Traits\HasSiteScope;

class Post extends BasePost {
    use HasSiteScope;
}
  1. 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 own ServiceProvider.

โœจ Credits

  • The Firefly Tech โ€” creators of the original plugin
  • K'Seven โ€” maintainer and multi-site extension author

๐Ÿ“„ License

MIT