stats4sd / filament-team-management
Package for an opinionated 'teams' setup, including invites and integration with Laravel Filament + Spatie User Roles
Fund package maintenance!
stats4sd
Requires
- php: ^8.1
- althinect/filament-spatie-roles-permissions: ^2.2
- awcodes/shout: ^2.0
- filament/filament: ^3.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.1
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-12-17 16:54:51 UTC
README
Package for an opinionated 'teams' setup, including invites and integration with Laravel Filament + Spatie User Roles.
Installation
You can install the package via composer:
composer require stats4sd/filament-team-management
Then, run the provided installation script.
php artisan filament-team-management:install
The script will ask you if you want to use the concept of "programs" in your app. Based on your response, it will publish the appropriate migration files and update your .env file with the appropriate variables. It will also offer to add some example Database Seeders to your main database/seeders/DatabaseSeeder.php
file.
For a full guide on how to set this package up with a brand new Laravel installation, see SETUP.md
Features
This app provides a set of models, Filament Resources and Mail classes that lets you quickly setup a Filament-based application that uses Teams to manage users.
Filament Resources
The intention is that this package is used for apps where you have 2 different Filament Panels:
- An "Admin" panel, for administrators to manage users and teams.
- An "App" panel, which uses multitenancy with teams as the tennant.
You can also optionally use 'programs', which are groups of teams. In this case, you may have a 3rd panel:
- A "Program" panel, for program managers to manage the users and teams within their own program.
The Resources in this package are intended for one of these 3 panels, shown by their namespacing within the package. You can add these Resource classes to any panel in your PanelProvider
class:
$panel ## add all resources in a namespace at once ->discoverResources(in: app_path('../vendor/stats4sd/filament-team-management/src/Filament/Admin/Resources'), for: 'Stats4sd\\FilamentTeamManagement\\Admin\\Resources) ## OR... add resources individually ->resources([ Stats4sd\\FilamentTeamManagement\\Admin\\Resources\\TeamResource, ... ])
Invitations
This package includes the needed setup to let your users invite other users via email. There are 3 different types of invite:
RoleInvite
: The provided UserResource lets you invite users to join the platform with a specific roleInvite
: The provided TeamResource lets you invite users to join a specific team on the platform.ProgramInvite
: If you use programs, the provided ProgramResource lets you invite users to join a specific program.
To make the registration work, you must add the pages in the namespace Stats4sd\\FilamentTeamManagement\\App\\Pages
to one of your Panels. Otherwise the registration pages will not be correctly registered in the app.
For example:
$panel ->discoverPages(in: app_path('../vendor/stats4sd/filament-team-management/src/Filament/App/Pages'), for: 'Stats4sd\\FilamentTeamManagement\\Filament\\App\\Pages')
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.