eightynine/filament-subscription
Composer 安装命令:
composer require eightynine/filament-subscription
包简介
Tenant subscriptions, entitlements, usage tracking, and billing (Paddle + Tanzania custom providers) for Filament v4.
README 文档
README
Tenant subscriptions, entitlements, usage tracking, and billing UI for Filament v4 (Laravel 12).
This plugin is installed in this project as a path repository (
plugins/eightynine/filament-subscription).
Requirements
- PHP 8.4+
- Laravel 12+
- Filament v4
Install (this repository)
This project already includes the path repository entry in the root composer.json:
{
"repositories": [
{
"type": "path",
"url": "plugins/eightynine/filament-subscription",
"options": { "symlink": true }
}
]
}
And the package requirement:
composer require eightynine/filament-subscription
If you add/update code in the plugin, run:
composer dump-autoload
Publish config
The package provides a config file you can publish:
php artisan vendor:publish --tag=filament-subscription-config
This will publish to:
config/filament-subscription.php
Run migrations
The plugin ships migrations under plugins/eightynine/filament-subscription/database/migrations and the service provider loads them automatically.
Run:
php artisan migrate
Set up features (entitlements)
This plugin supports code-defined features (synced into the DB) and/or seeded features.
Option A: Code-defined features (recommended)
- Create a registrar class in your app that implements
Eightynine\FilamentSubscription\Features\FeatureRegistrarand returns an array ofFeatureDefinitionobjects. - Register that registrar class in
config/filament-subscription.php:
'feature_registrars' => [ App\Billing\BillingFeatureRegistrar::class, ],
- Sync the feature definitions into the database:
php artisan filament-subscription:sync-features
Option B: Seeded features (quick start)
This repository includes example seeders that create common quotas/modules:
php artisan db:seed --class=Database\\Seeders\\BillingFeatureSeeder php artisan db:seed --class=Database\\Seeders\\BillingPlanSeeder
Set up plans (pricing)
Plans + entitlements live in the billing tables:
billing_plansbilling_plan_pricesbilling_plan_feature_entitlements
You can create/update these via:
- Seeders (see above)
- Your own admin UI/resources (if you expose the package models via Filament)
Ensure plugin views are included in Tailwind / Filament theme builds
Filament pages/widgets in this plugin render Blade views under:
plugins/eightynine/filament-subscription/resources/views/**
Since Tailwind v4 uses file scanning via @source, you must ensure those plugin view paths are included, otherwise Tailwind may purge classes used by the plugin UI.
Add this @source line to your Filament theme CSS:
resources/css/filament/app/theme.css
@source '../../../../plugins/eightynine/filament-subscription/resources/views/**/*';
Then rebuild assets:
npm run build
Register the Filament plugin
Register the plugin in your Filament panel provider (example):
use Eightynine\FilamentSubscription\FilamentSubscriptionPlugin; $panel ->plugins([ FilamentSubscriptionPlugin::make(), ]);
Where does the UI show?
The ManageSubscription page is wired to appear in the User Menu (top-right profile dropdown) by default.
If you also want it in the sidebar navigation, set the config value:
filament-subscription.ui.manage_subscription.navigation_menu=>true
Tenant model setup (Company)
This plugin is tenant-aware via Filament::getTenant().
Your tenant model (commonly App\Models\Company) should:
- Use the trait:
Eightynine\FilamentSubscription\Traits\HasSubscription - Be configured as your Filament tenant model (panel tenancy)
The trait provides:
subscription()morph-one relationshipgetFeatureLimit($key)andcanConsume($featureKey, $currentUsage)- Convenience helpers used by the billing UI:
onTrial()trialEndsAt()$company->billablePlan(accessor)
Webhooks
Webhook routes are loaded from:
plugins/eightynine/filament-subscription/routes/webhooks.php
Configure your billing provider to send webhooks to the route(s) defined there.
Console commands
The package registers (when running in console):
SyncBillingFeaturesCommand(seesrc/Console/Commands)
You can list all commands with:
php artisan list
What the plugin provides
- Billing models (plans, subscriptions, invoices, payments, usage records)
- Policies for package resources/models
- A customer-facing Filament page:
Eightynine\FilamentSubscription\Filament\Pages\ManageSubscription
- Supporting Filament widgets (used on the page):
InvoicesTablePaymentsTableCompanySubscriptionStats
Usage
Open Filament, switch/select a tenant (Company), then use:
- User Menu �7 Billing & Subscription
Tabs include:
- Status
- Pricing
- Invoices
- Payments
- Payment Methods
Notes / Troubleshooting
- Views not found: ensure
FilamentSubscriptionServiceProviderloads views and you rancomposer dump-autoloadafter changes. - Tenant is null: the billing UI expects
Filament::getTenant()to be set (panel tenancy configured). - Livewire component not found: ensure the widget class exists under the namespace referenced in the Blade view, and autoload has been refreshed.
eightynine/filament-subscription 适用场景与选型建议
eightynine/filament-subscription 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 eightynine/filament-subscription 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 eightynine/filament-subscription 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 40
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-01-16