PHPackages                             stats4sd/filament-team-management - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. stats4sd/filament-team-management

ActiveLibrary[Admin Panels](/categories/admin)

stats4sd/filament-team-management
=================================

Package for an opinionated 'teams' setup, including invites and integration with Laravel Filament + Spatie User Roles

v4.0.7(3mo ago)74481[1 issues](https://github.com/stats4sd/filament-team-management/issues)[1 PRs](https://github.com/stats4sd/filament-team-management/pulls)MITPHPPHP ^8.4CI passing

Since Oct 30Pushed 5d ago1 watchersCompare

[ Source](https://github.com/stats4sd/filament-team-management)[ Packagist](https://packagist.org/packages/stats4sd/filament-team-management)[ Docs](https://github.com/stats4sd/filament-team-management)[ GitHub Sponsors](https://github.com/stats4sd)[ RSS](/packages/stats4sd-filament-team-management/feed)WikiDiscussions dev Synced today

READMEChangelog (10)Dependencies (16)Versions (30)Used By (0)

Filament Team Management
========================

[](#filament-team-management)

[![Latest Version on Packagist](https://camo.githubusercontent.com/29113e46d200f0eb4c5e7f9773471f2d3c5c616742a63042208e50439a549606/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746174733473642f66696c616d656e742d7465616d2d6d616e6167656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/filament-team-management)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b9377c67133bc5f095f73bec808ee93956832adbe76bf5bcdb25b785cac4825a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746174733473642f66696c616d656e742d7465616d2d6d616e6167656d656e742f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/stats4sd/filament-team-management/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/10609417545f71c1be2d05f378042db199f1a8083408078e35ebeaf5b696d2e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f73746174733473642f66696c616d656e742d7465616d2d6d616e6167656d656e742f6669782d7068702d636f64652d7374796c696e672e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/stats4sd/filament-team-management/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/81cae5d7524f93f8d9ffa177e6d77cccaeb4f67cf4cdc0aebf9e7f9e9c25e608/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746174733473642f66696c616d656e742d7465616d2d6d616e6167656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/filament-team-management)

Package for an opinionated 'teams' setup, including invites and integration with Laravel Filament + Spatie User Roles.

Installation
============

[](#installation)

You can install the package via composer:

```
composer require stats4sd/filament-team-management
```

Then, run the provided installation script. It's recommended to do a git commit before running this command, as it will update several files in your app. You will want to review these changes after running the command.

```
php artisan filament-team-management:install
```

The script will ask you if you want to use the concept of "programs" in your app. It will then make the following changes:

1. It will publish the appropriate migration files.
2. It will update your .env file with the appropriate variables.
3. It will offer to add some example Database Seeders to your main `database/seeders/DatabaseSeeder.php` file.

Integration into your app
=========================

[](#integration-into-your-app)

Models
------

[](#models)

The package provides 3 Eloquent Models that you can use in your app:

- `Stats4sd\FilamentTeamManagement\Models\Team` - represents a Team. Teams can have many Users.
- `Stats4sd\FilamentTeamManagement\Models\Program` - represents a Program. Programs can have many Teams. This model is optional, depending on whether you chose to use Programs during installation.
- `Stats4sd\FilamentTeamManagement\Models\User` - extends the default Laravel User model to add relationships to Teams (and Programs, if used), and includes traits for Spatie Roles and Filament User functionality.

In theory, you can use these models as-is in your app. However, in practice, you will likely want to extend them to add your own fields and functionality. To do this, create your own Models that extend the package Models. For example, you might create `App\Models\Team` like this:

```
namespace App\Models;
use Stats4sd\FilamentTeamManagement\Models\Team as BaseTeam;

class Team extends BaseTeam
{
    // Add your customizations and overrides here
}
```

Then, update your .env file to point to your own model:

```
FILAMENT_TEAM_MANAGEMENT_TEAM_MODEL=App\Models\Team

```

Note

You are not required to call your custom models `Team`, `Program` or `User`. You can name them whatever you like, as long as you update the .env variables to point to your custom models. Use the other .env variables to point to the correct database tables, foreign key column names and pivot tables if you have changed them.

Filament Panels
---------------

[](#filament-panels)

The package does not provide its own Filament Panel (yet). Instead, you are expected to integrate the package's pages and resources into your own Filament Panels.

The package's resources and pages are namespaced into 3 groups, depending on their intended panel:

- `Stats4sd\FilamentTeamManagement\Filament\Admin` - Resources and pages intended for site-wide administrators to manage users, teams and programs.
- `Stats4sd\FilamentTeamManagement\Filament\Program` - Resources and pages intended for program managers to manage users and teams within their own program.
- `Stats4sd\FilamentTeamManagement\Filament\App` - Resources and pages intended for general users of the application. This includes pages to manage the current team.

The default approach is that you will have 2 or 3 different Filament Panels in your app:

- An "Admin" panel for site-wide admins.
- An "App" panel for general users of the application.
- Optionally, a "Program" panel for program managers.

### App Panel

[](#app-panel)

The "App" panel is the main entry point for your application. This is where your users will log in and manage their teams.

To configure your "App" panel to use the authentication and team management features from this package,, do the following:

```
return $panel
    ...
    // Make sure this is the default panel
    ->default()
    // Add the authentication pages from the package
    ->login(Stats4sd\FilamentTeamManagement\Filament\Auth\Login::class)
    ->registration(Stats4sd\FilamentTeamManagement\Filament\Auth\Register::class)

    // Add multitenancy (using your 'team' model) and the profile + registration pages
    ->tenant(App\Models\Team::class) // your team model
    ->tenantProfile(Stats4sd\FilamentTeamManagement\Filament\App\Pages\ManageTeam\ManageTeam::class)
    ->tenantRegistration(Stats4sd\FilamentTeamManagement\Filament\App\Pages\RegisterTeam::class)

    // Add the resources and pages from the App namespace
    ->discoverPages(
        in: base_path('vendor/stats4sd/filament-team-management/src/Filament/App/Pages'),
        for: 'Stats4sd\FilamentTeamManagement\Filament\App\Pages'
    )

    // optionally, add a link to the admin panel
    ->navigationItems([
        NavigationItem::make('admin')
            ->url('/admin')
            ->label('Admin Panel')
            ->icon('heroicon-o-cog')
            ->visible(fn () => auth()->user()->can('viewAdminPanel')),
    ]);
```

You can edit any of the pages or resources from the package by creating new classes and extending the package classes. For example, to customize the `ManageTeam` page, create a new class in your app like this:

```
namespace App\Filament\Pages\ManageTeam;

use Stats4sd\FilamentTeamManagement\Filament\App\Pages\ManageTeam\ManageTeam as BaseManageTeam;

class ManageTeam extends BaseManageTeam
{
    // Add your customizations and overrides here
}
```

Then, update the `tenantProfile` method in your panel provider to point to your new class.

### Program Panel

[](#program-panel)

If you are using the "program" concept in your app, you may want to create a separate Filament Panel for program managers. This panel will allow program managers to manage users and teams within their own program.

To configure your "Program" panel, do the following:

```
return $panel
    ...
    // Add multitenancy (using your 'program' model)
    ->tenant(App\Models\Program::class) // your program model
    ->tenantProfile(Stats4sd\FilamentTeamManagement\Filament\Program\Pages\ManageProgram\ManageProgram::class)
    ->tenantRegistration(Stats4sd\FilamentTeamManagement\Filament\Program\Pages\RegisterProgram::class)

    // Add the resources and pages from the Program namespace
    ->discoverPages(
        in: base_path('vendor/stats4sd/filament-team-management/src/Filament/Program/Pages'),
        for: 'Stats4sd\FilamentTeamManagement\Filament\Program\Pages'
    )

    // the package assumes that all users will register and log in via the 'App' (default) panel, so this panel should not have a `login()` or `registration()` method. To ensure users are redirected to the correct login page, add _replace_ the `Authenticate::class` in authMiddleware with the following:
    ->authMiddleware([
        \Stats4sd\FilamentTeamManagement\Http\Middleware\AuthenticateThroughDefaultPanel::class,
    ])

    // optionally, add links to the other panels
    ->navigationItems([
        NavigationItem::make('admin')
            ->url('/admin')
            ->label('Admin Panel')
            ->icon('heroicon-o-cog')
            ->visible(fn() => auth()->user()->can('viewAdminPanel')),
        NavigationItem::make('app')
            ->url('/')
            ->icon('heroicon-o-arrow-left')
            ->label('Back to Front End'),
    ]);
```

### Admin Panel

[](#admin-panel)

The "Admin" panel is for site-wide administrators to manage users, teams and programs. To configure your "Admin" panel, do the following:

```
return $panel
    ...
    // Add the resources and pages from the Admin namespace
    ->discoverPages(
        in: base_path('vendor/stats4sd/filament-team-management/src/Filament/Admin/Pages'),
        for: 'Stats4sd\FilamentTeamManagement\Filament\Admin\Pages'
    )
    ->discoverResources(
        in: base_path('vendor/stats4sd/filament-team-management/src/Filament/Admin/Resources'),
        for: 'Stats4sd\FilamentTeamManagement\Filament\Admin\Resources'
    )

    // the package assumes that all users will register and log in via the 'App' (default) panel, so this panel should not have a `login()` or `registration()` method. To ensure users are redirected to the correct login page, add _replace_ the `Authenticate::class` in authMiddleware with the following:
    ->authMiddleware([
        \Stats4sd\FilamentTeamManagement\Http\Middleware\AuthenticateThroughDefaultPanel::class,
    ])

    // optionally, add links to the other panels
    ->navigationItems([
        NavigationItem::make('program')
            ->url('/program')
            ->label('Go to program panel')
            ->icon('heroicon-o-cog')
            ->visible(fn() => auth()->user()->can('viewAdminPanel')),
        NavigationItem::make('app')
            ->url('/')
            ->icon('heroicon-o-arrow-left')
            ->label('Back to Front End'),
    ]);
```

### Invitations and User Registration

[](#invitations-and-user-registration)

This package includes the needed setup to let your users invite other users via email. You can invite a new user to join a specific team, a specific program, or with an assigned site-wide role.

The setup described above uses the package's Auth pages for login and registration through the defualt 'App' panel. These pages include the needed functionality to handle invitations and user registration. Through this default setup:

- Users can *only* register via an invitation. Going to the registration page without an invitation code will redirect to the login page.
- Team members can invite new users to join their team through the "Manage Team" page.
- Program managers can invite new users to join their program through the "Manage Program" page.
- Site-wide admins can invite new users to the system through the "Manage Users" resource in the Admin panel. They can also invite users to join specific teams or programs through the Team and Program resources in the Admin panel.

TODO: check how invitation email customisation can work.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Dan Tang](https://github.com/stats4sd)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

TODO:

- add info on SetLatestTeam middleware - must be in the TenantMiddleware.

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance88

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 59.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~27 days

Recently: every ~6 days

Total

16

Last Release

103d ago

Major Versions

v1.1 → v2.02025-06-16

v2.1 → v4.02025-11-13

PHP version history (2 changes)v1.0PHP ^8.1

v4.0.1PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a7ba5ca40fde83339632231db5f6a95522c1de137f0029a338a5d90fa449a46?d=identicon)[dave-mills](/maintainers/dave-mills)

---

Top Contributors

[![dave-mills](https://avatars.githubusercontent.com/u/5711101?v=4)](https://github.com/dave-mills "dave-mills (165 commits)")[![dan-tang-ssd](https://avatars.githubusercontent.com/u/86968034?v=4)](https://github.com/dan-tang-ssd "dan-tang-ssd (98 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (10 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

laravelstats4sdfilament-team-management

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/stats4sd-filament-team-management/health.svg)

```
[![Health](https://phpackages.com/badges/stats4sd-filament-team-management/health.svg)](https://phpackages.com/packages/stats4sd-filament-team-management)
```

###  Alternatives

[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

203110.1k1](/packages/guava-filament-knowledge-base)[andreia/filament-ui-switcher

Add a modal with options to switch between different UI layouts and styles (colors, fonts, font sizes).

223.1k](/packages/andreia-filament-ui-switcher)[lara-zeus/tartarus

simple multi tenants

112.6k](/packages/lara-zeus-tartarus)[alareqi/filament-pwa

A comprehensive PWA (Progressive Web App) plugin for Filament v3 and v4 admin panels with offline functionality, installation prompts, and icon generation.

112.5k](/packages/alareqi-filament-pwa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
