laraveldaily/filateams
Composer 安装命令:
composer require laraveldaily/filateams
包简介
Team management plugin for Filament, compatible with Laravel starter kit teams.
README 文档
README
Team management plugin for Filament 5. This is the exact implementation of Laravel 13 Starter Kit Teams functionality, just in Filament.
Adds full team functionality — creating teams, switching between them, inviting members, managing roles — wired into Filament's panel with zero configuration on your part.
Package Demo
Here's a 7-minute YouTube video with package demo.
For reference, I also have a 33-minute video course on Laravel 13 Teams customizations.
Screenshots
Requirements
- PHP 8.2+
- Laravel 12 or 13
- Filament 5
This package is designed to be installed on a fresh Filament project, right after filament:install --panels. It creates its own database tables and takes over the panel's tenancy system, so it's best to set it up before building your resources and pages on top.
Installation
1. Install via Composer
composer require laraveldaily/filateams
2. Update your User model
Add the HasTeamMembership interface and HasTeams trait:
use LaravelDaily\FilaTeams\Concerns\HasTeams; use LaravelDaily\FilaTeams\Contracts\HasTeamMembership; class User extends Authenticatable implements HasTeamMembership { use HasTeams; // ... rest of your model }
3. Register the plugin in your PanelProvider
use LaravelDaily\FilaTeams\FilaTeamsPlugin; public function panel(Panel $panel): Panel { return $panel // ... your existing config ->registration() // enable if not already ->plugin(FilaTeamsPlugin::make()); }
4. Run migrations
php artisan migrate
That's it. No additional configuration needed.
What you get
- Automatic personal team — when a user registers, a personal team ("{name}'s Team") is created automatically
- Team switcher — Filament's built-in tenant switcher lets users switch between their teams
- Create team — available at
/admin/new - Team settings page — at
/admin/{team}/settings, with sections for:- Updating team name
- Managing members (change roles, remove members, leave team)
- Inviting new members by email
- Deleting the team (non-personal teams only, owner only)
- Email invitations — invited users receive an email with an accept link
- Role-based permissions — Owner, Admin, and Member roles with granular permissions
Roles & Permissions
| Permission | Owner | Admin | Member |
|---|---|---|---|
| Update team name | Yes | Yes | - |
| Delete team | Yes | - | - |
| Add/remove members | Yes | - | - |
| Change member roles | Yes | - | - |
| Create invitations | Yes | Yes | - |
| Cancel invitations | Yes | Yes | - |
The built-in roles and permissions can be replaced entirely. Publish the config and point enums.role and enums.permission to your own string-backed enum classes that implement TeamRoleContract and TeamPermissionContract:
// config/filateams.php 'enums' => [ 'role' => App\Enums\MyTeamRole::class, 'permission' => App\Enums\MyTeamPermission::class, ],
See src/Contracts/TeamRoleContract.php for the full interface your custom role enum must satisfy.
Invitation flow
- An Owner or Admin invites a user by email from the team settings page
- The invited user receives an email with an accept link
- If they're logged in and the email matches — they're added to the team immediately
- If they're not logged in — they're redirected to login first, then back to accept
- Invitations expire after 7 days (configurable)
For existing users
If you install the package on a project that already has users, those users won't have teams yet. Create personal teams for them:
use App\Models\User; use LaravelDaily\FilaTeams\Actions\CreateTeam; $action = new CreateTeam; User::whereDoesntHave('teams')->each(function ($user) use ($action) { $action->handle($user, [ 'name' => $user->name . "'s Team", 'is_personal' => true, ]); });
You can run this in tinker or in a seeder/migration.
Configuration
Publish the config file:
php artisan vendor:publish --tag=filateams-config
This creates config/filateams.php:
return [ // Override the role and permission enum classes 'enums' => [ 'role' => LaravelDaily\FilaTeams\Enums\TeamRole::class, 'permission' => LaravelDaily\FilaTeams\Enums\TeamPermission::class, ], // Override model classes if you need to extend them 'models' => [ 'team' => LaravelDaily\FilaTeams\Models\Team::class, 'membership' => LaravelDaily\FilaTeams\Models\Membership::class, 'invitation' => LaravelDaily\FilaTeams\Models\TeamInvitation::class, ], // How long invitations are valid 'invitation' => [ 'expires_after_days' => 7, ], // Create a personal team when a user registers 'create_personal_team_on_registration' => true, ];
Translations
To publish the language files to your application:
php artisan vendor:publish --tag=filateams-translations
This copies the files to lang/vendor/filateams/ where you can modify existing translations or add new languages by creating a folder named after the locale (e.g. lang/vendor/filateams/de/filateams.php).
Database schema
The package creates three tables and adds one column:
teams — id, name, slug (unique), is_personal, timestamps, soft_deletes
team_members — id, team_id, user_id, role, timestamps (unique on team_id + user_id)
team_invitations — id, code (unique, 64 chars), team_id, email, role, invited_by, expires_at, accepted_at, timestamps
users — adds current_team_id (nullable foreign key to teams)
This schema matches the Laravel 13 starter kit exactly.
License
MIT
laraveldaily/filateams 适用场景与选型建议
laraveldaily/filateams 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 177 次下载、GitHub Stars 达 18, 最近一次更新时间为 2026 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「multi-tenancy」 「Teams」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 laraveldaily/filateams 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laraveldaily/filateams 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 laraveldaily/filateams 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
User to Team associations for the Laravel Framework
A simple PHP package for sending messages to Microsoft Teams
Remove personal team forcing from Laravel Jetstream
Multi-tenancy handling for PHP apps.
Second-level tenancy scope (e.g. service area, region, location) for Filament panels — topnav dropdown filter that scopes Eloquent queries globally.
This package allows you to persists setting for Laravel projects.
统计信息
- 总下载量: 177
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 18
- 点击次数: 40
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-02