Download the PHP package stats4sd/filament-team-management without Composer
On this page you can find all versions of the php package stats4sd/filament-team-management. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stats4sd/filament-team-management
More information about stats4sd/filament-team-management
Files in stats4sd/filament-team-management
Package filament-team-management
Short Description Package for an opinionated 'teams' setup, including invites and integration with Laravel Filament + Spatie User Roles
License MIT
Homepage https://github.com/stats4sd/filament-team-management
Informations about the package filament-team-management
Filament Team Management
Package for an opinionated 'teams' setup, including invites and integration with Laravel Filament + Spatie User Roles.
Installation
You can install the package via composer:
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.
The script will ask you if you want to use the concept of "programs" in your app. It will then make the following changes:
- It will publish the appropriate migration files.
- It will update your .env file with the appropriate variables.
- It will offer to add some example Database Seeders to your main
database/seeders/DatabaseSeeder.phpfile.
Integration into your app
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:
Then, update your .env file to point to your own model:
[!NOTE] You are not required to call your custom models
Team,ProgramorUser. 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
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
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:
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:
Then, update the tenantProfile method in your panel provider to point to your new class.
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:
Admin Panel
The "Admin" panel is for site-wide administrators to manage users, teams and programs. To configure your "Admin" panel, do the following:
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
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
- Dan Tang
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
TODO:
- add info on SetLatestTeam middleware - must be in the TenantMiddleware.
All versions of filament-team-management with dependencies
filament/filament Version ^4.2
spatie/laravel-package-tools Version ^1.15.0
awcodes/shout Version ^3.0
althinect/filament-spatie-roles-permissions Version ^3.x-dev
livewire/livewire Version ^3.6.4