Skip to content

KDevelopement/filament-multi-blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filament Multi Blog (by site_id)

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


📄 License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages