Laravel启动器

FilaTeams — Laravel 启动器模板

作者 LaravelDaily

FilaTeams 是 LaravelDaily 开发的 Filament 团队管理插件,把 Laravel Starter Kit 的团队功能(建团队、切换团队、邀请成员、角色权限)复刻到 Filament 面板中。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

1 个预览视图
作者提供的预览
作者提供的预览首屏预览

来自项目 README 的原始预览。

目前有 1 张原始预览,可打开完整图片查看设计细节。

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-02查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

把 Laravel Starter Kit 的 Teams 功能以 Filament 插件形式实现,安装后接管面板租户系统

02

注册时自动创建个人团队,并复用 Filament 内置租户切换器在团队间切换

03

团队设置页涵盖改名、成员管理、邮箱邀请和删除团队(仅限非个人团队且仅 Owner)

04

内置 Owner/Admin/Member 角色与权限矩阵,可通过配置替换为自定义枚举类

05

邀请邮件带接受链接,未登录用户先登录再接受,邀请默认 7 天过期且可配置

06

提供配置发布与翻译发布命令,可自定义模型类、枚举类与多语言文案

模板详细介绍

FilaTeams 是一个面向 Filament 面板的团队管理插件,作者为 LaravelDaily。它把 Laravel Starter Kit 中的 Teams 功能完整搬到 Filament 上:用户注册时自动创建个人团队(“{name}'s Team”),通过 Filament 内置的租户切换器在多个团队间切换,并提供团队设置页用于改名、管理成员、按邮箱邀请新成员以及删除团队。

权限模型内置 Owner、Admin、Member 三种角色,权限划分明确:改名由 Owner 和 Admin 执行;删除团队、增删成员、变更成员角色仅 Owner 可操作;创建与取消邀请 Owner 和 Admin 均可。角色与权限枚举可通过发布配置文件替换为自定义的字符串枚举类,只需实现 TeamRoleContract 与 TeamPermissionContract。

邀请流程为:Owner 或 Admin 在团队设置页按邮箱发出邀请,被邀请人收到含接受链接的邮件;已登录且邮箱匹配则直接加入团队,未登录则先跳转登录再回到接受页。邀请默认 7 天后过期,可在配置中调整。

安装前提是 PHP 8.2+、Laravel 12 或 13、Filament 5,且建议在刚执行完 filament:install --panels 的全新 Filament 项目上安装,因为插件会创建自己的数据表并接管面板的租户系统。对已有用户的项目,README 提供了通过 CreateTeam 动作批量补建个人团队的示例。数据库层面会新建 teams、team_members、team_invitations 三张表,并在 users 表增加 current_team_id 字段,作者称该结构与 Laravel 13 starter kit 一致。

项目采用 MIT 许可,可免费使用、修改、商用和分发,分发时需保留版权与许可声明;演示图片等第三方素材需单独核对许可。

Laravel启动器

适合你的项目吗?

适用场景

  • 在全新 Filament 面板项目上快速获得多团队与成员邀请能力
  • 需要按 Owner/Admin/Member 区分团队管理权限的后台系统
  • 希望沿用 Filament 租户切换器而非自建团队切换界面的项目
  • 需要把团队角色与权限替换为自有枚举的业务场景

适合人群

  • 使用 Laravel 12 或 13 与 Filament 5 的后台项目
  • 刚执行完 filament:install --panels、尚未构建资源与页面的新项目
  • 需要邮箱邀请成员并带过期机制的团队协作后台
  • 接受 MIT 许可并愿意保留版权声明的开发者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    环境要求 PHP 8.2+、Laravel 12 或 13、Filament 5,建议在全新 Filament 项目上安装

  2. 2

    通过 composer require laraveldaily/filateams 安装,再让 User 模型实现 HasTeamMembership 并使用 HasTeams trait

  3. 3

    在 PanelProvider 中注册 FilaTeamsPlugin,并确保已启用 registration(),然后执行 php artisan migrate

  4. 4

    已有用户的项目需用 CreateTeam 动作手动补建个人团队,否则这些用户没有团队

  5. 5

    可用 vendor:publish 发布 filateams-config 与 filateams-translations 以调整枚举、模型、邀请有效期和文案

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 该插件设计用于全新的 Filament 项目,建议在刚执行完 filament:install --panels 后立即安装;因为它会创建自己的数据表并接管面板的租户系统,最好在构建资源与页面之前完成安装。
  • 在已有用户的项目上安装时,这些既有用户不会自动拥有团队,需要自行运行 README 提供的 CreateTeam 动作示例为其补建个人团队。
  • 使用需满足运行环境要求:PHP 8.2 及以上、Laravel 12 或 13、Filament 5,不满足则无法使用。
  • 邀请默认 7 天后过期,可通过发布配置调整有效期;过期后邀请链接失效。
  • 删除团队仅限非个人团队且仅限 Owner 角色操作,个人团队无法删除。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

This package is designed to be installed on a **fresh Filament project**, right after `filament:install --panels`.

README 原文

If you install the package on a project that already has users, those users won't have teams yet.

README 原文

- PHP 8.2+ - Laravel 12 or 13 - Filament 5

README 原文

Invitations expire after 7 days (configurable)

README 原文

Deleting the team (non-personal teams only, owner only)

README 原文
https://github.com/LaravelDaily/FilaTeams/blob/main/LICENSE.mdhttps://github.com/LaravelDaily/FilaTeams/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-02。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 75 / 100
技术栈
Laravel
网站类型
启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-04-09
截图检查日期
2026-10-02

目前没有记录演示链接。请依据仓库说明在本地评估;仅凭截图无法确认交互行为。

目录记录的主要技术栈是 Laravel。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 6c72bacb6a3cb0f7193972205304fb905fc1fbd33f31d62be7b2557556f32e30

2026-10-02T18:53:11.312Z

来源文件 / 仓库
# FilaTeams

Team management plugin for Filament 5. This is the exact implementation of [Laravel 13 Starter Kit Teams](https://www.youtube.com/watch?v=mJtOxawILJk) 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](https://www.youtube.com/watch?v=YlO_6ZI55ag).

For reference, I also have a [33-minute video course on Laravel 13 Teams customizations](https://laraveldaily.com/course/laravel-13-teams).

---

## Screenshots

![](https://laraveldaily.com/uploads/2026/04/filateams-switch-team.png)

---

![](https://laraveldaily.com/uploads/2026/04/filateams-team-settings.png)

---

![](https://laraveldaily.com/uploads/2026/04/filateams-invite-user.png)

---

## 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

```bash
composer require laraveldaily/filateams
```

### 2. Update your User model

Add the `HasTeamMembership` interface and `HasTeams` trait:

```php
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

```php
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

```bash
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`:

```php
// config/filateams.php
'enums' => [
    'role'       => App\Enums\MyTeamRole::class,
    'permission' => App\Enums\MyTeamPermission::class,
],
```

See [`src/Contracts/TeamRoleContract.php`](src/Contracts/TeamRoleContract.php) for the full interface your custom role enum must satisfy.

---

## Invitation flow

1. An Owner or Admin invites a user by email from the team settings page
2. The invited user receives an email with an accept link
3. If they're logged in and the email matches — they're added to the team immediately
4. If they're not logged in — they're redirected to login first, then back to accept
5. 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:

```php
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:

```bash
php artisan vendor:publish --tag=filateams-config
```

This creates `config/filateams.php`:

```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:

```bash
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
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。