定制 kseven/filament-multiblog 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kseven/filament-multiblog

Composer 安装命令:

composer require kseven/filament-multiblog

包简介

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

README 文档

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

📄 License

MIT

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-22