jeffersongoncalves/filament-teams
Composer 安装命令:
composer require jeffersongoncalves/filament-teams
包简介
A Filament plugin that adds multi-tenancy with Teams, memberships, and team invitations to your panels.
关键字:
README 文档
README
Filament Teams
A Filament plugin that adds multi-tenancy with Teams, memberships, and team invitations to your panels. It ships everything you need to turn a single-tenant Filament panel into a team-based, multi-tenant application: a HasTeams trait for your User model, tenant registration and profile pages, an invitation acceptance flow, and optional admin resources to manage Teams and Team Invitations.
Features
- 🏢 Multi-tenancy backed by a
Teammodel - 👥 Team memberships through a pivot model
- ✉️ Team invitations with accept / cancel flow
- 🪪 Personal team automatically created for every new user
- 🧩
HasTeamstrait wiring all tenancy contracts - 🛠️ Optional admin resources for Teams and Team Invitations
- ⚙️ Publishable configuration and migrations (models, tables and guard are configurable)
Compatibility
| Plugin Version | Filament | PHP | Laravel |
|---|---|---|---|
| 1.x | ^3.0 | ^8.1 | ^10.0 |
| 2.x | ^4.0 | ^8.2 | ^11.0 |
| 3.x | ^5.0 | ^8.3 | ^12.0/^13.0 |
Installation
You can install the package via composer:
composer require jeffersongoncalves/filament-teams:"^3.0"
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-teams-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-teams-config"
Usage
1. Prepare your User model
Add the HasTeams trait and implement the Filament tenancy contracts on your User model. Your users table needs a current_team_id column (provided by the published migration).
use Filament\Models\Contracts\FilamentUser; use Filament\Models\Contracts\HasDefaultTenant; use Filament\Models\Contracts\HasTenants; use Illuminate\Foundation\Auth\User as Authenticatable; use JeffersonGoncalves\Filament\Teams\Concerns\HasTeams; class User extends Authenticatable implements FilamentUser, HasDefaultTenant, HasTenants { use HasTeams; }
2. Register the plugin
use JeffersonGoncalves\Filament\Teams\FilamentTeamsPlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ FilamentTeamsPlugin::make() ->tenancy() // enable tenant config (default: true) ->invitations() // register the invitation acceptance page (default: true) ->resources() // register the Teams & Team Invitations admin resources (default: false) ->tenantRoutePrefix('team'), ]); }
The plugin will automatically configure the panel tenant model, tenant registration page, tenant profile page, and the tenant middleware.
Configuration
return [ 'guard' => 'web', 'user_model' => 'App\\Models\\User', 'personal_teams' => true, 'models' => [ 'team' => \JeffersonGoncalves\Filament\Teams\Models\Team::class, 'team_invitation' => \JeffersonGoncalves\Filament\Teams\Models\TeamInvitation::class, 'membership' => \JeffersonGoncalves\Filament\Teams\Models\Membership::class, ], 'tables' => [ 'teams' => 'teams', 'memberships' => 'membership', 'team_invitations' => 'team_invitations', ], ];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-24
