PHPackages                             stats4sd/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. stats4sd/laravel-team-management

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

stats4sd/laravel-team-management
================================

This is my package laravel-team-management

v0.1.0(2y ago)21.4k↑50%2[1 PRs](https://github.com/stats4sd/laravel-team-management/pulls)MITPHPPHP ^8.1CI passing

Since Aug 3Pushed 1y ago1 watchersCompare

[ Source](https://github.com/stats4sd/laravel-team-management)[ Packagist](https://packagist.org/packages/stats4sd/laravel-team-management)[ Docs](https://github.com/stats4sd/laravel-team-management)[ RSS](/packages/stats4sd-laravel-team-management/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (13)Versions (3)Used By (0)

Laravel Team Management
=======================

[](#laravel-team-management)

[![Latest Version on Packagist](https://camo.githubusercontent.com/de544e4f6e3c999b6c151d0481b89512f1286b478160bb3195b61fea05fd7202/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73746174733473642f6c61726176656c2d7465616d2d6d616e6167656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/laravel-team-management)[![GitHub Tests Action Status](https://camo.githubusercontent.com/5da0704646b94d93043db4c8695d627e7424ddc4d67dd96af81be8da05a51db7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73746174733473642f6c61726176656c2d7465616d2d6d616e6167656d656e742f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/stats4sd/laravel-team-management/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ebf6f1e25843f3996d5791c50d73b747ddce95bba662a2e29be3cabd243aef50/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f73746174733473642f6c61726176656c2d7465616d2d6d616e6167656d656e742f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/stats4sd/laravel-team-management/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/674c78bd7f20be0ccc8b59e30ecb78c622bc6e6fa85827995664e1995b6066e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73746174733473642f6c61726176656c2d7465616d2d6d616e6167656d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stats4sd/laravel-team-management)

This package is an opinionated way to add teams of users to your Laravel application. It includes multiple ways to invite new users via email, and integrates with Laravel Backpack so you can manage teams and user invites via a clean CRUD panel interface.

The package is intended for use in a Laravel Backpack application, and works best when you also use Laravel Backpack Permission Manager / Spatie Permission Manager to assign users site-wide roles. You can use it in an application that doesn't use Backpack at all, but it will take some extra work to build the pages and integrate the team management blade templates.

Installation
------------

[](#installation)

You can install the package via composer:

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

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="team-management-migrations"
php artisan migrate
```

You can also choose to publish the config file, but we recommend instead that you set the needed config items in your .env file.

```
php artisan vendor:publish --tag="team-management-config"
```

If you want to overwrite or modify the package routes, you can publish the routes file. The package's internal routes will not be loaded if this file (`/routes/backpack/team-management.php`) exists in your application.

```
php artisan vendor:publish --tag="team-management-routes"
```

Setup
-----

[](#setup)

To link users to teams, the package needs to know what your application's 'User' model is. The default is to look for '\\App\\Models\\User'. If you use a different model, please add the following entry in your .env file:

```
TEAM_MANAGEMENT_USER_MODEL='\Fqdn\Of\Your\Model'

```

You should also add the `HasTeamMemberships` trait to your User model. This trait defines the required relationships to the team, and adds some functionality to enable the invites feature to work as intended.

If you use Permission Manager, you should also define the `SITE_ADMIN_ROLE`. Users with this role will have full access to all teams. By default, this is set to `admin`, but if you use a different convention, please add it to your .env file.

### CRUD Panels

[](#crud-panels)

The package includes 3 crud panels. The links to these panels are:

- **TeamCrudController**: `backpack_url("team")`
- **InviteCrudController** `backpack_url("invite")`
- **RoleInviteCrudController** `backpack_url("role-invite")`

You can run the following command to automatically add links at the bottom of your `resources/views/vendor/backpack/base/inc/sidebar_content.blade.php` file:

```
php artisan team-management:crud
```

You can also manually add those links to your sidebar, or anywhere else in your application.

Package Features
----------------

[](#package-features)

### Team Management

[](#team-management)

- Users are linked to teams via a many-many relationship.
- Users can be "members" or "admins" of a team, which is defined on the relationship pivot table with an "is\_admin" boolean field.
- Only team admins or site admins can manage the members of a team.
    - This is defined in the TeamPolicy class, which is referenced in the TeamCrudController to authorise requests.

The TeamCrudController provides the basic pages required to:

- Create a new team.
- Edit an existing team.
- Manage the team members (via the 'preview' link). This uses the Backpack 'show' operation with a custom blade template. From this page, you can invite or add new members, set existing members as team admins or regular members, or remove users from the team. [![](https://private-user-images.githubusercontent.com/5711101/285511132-c0a6439b-cedb-49f7-8d1c-82762294f03a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzIyNzc0OTgsIm5iZiI6MTc3MjI3NzE5OCwicGF0aCI6Ii81NzExMTAxLzI4NTUxMTEzMi1jMGE2NDM5Yi1jZWRiLTQ5ZjctOGQxYy04Mjc2MjI5NGYwM2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDIyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAyMjhUMTExMzE4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2ExYThmZTg5NTczM2M2MTY4MDEzZWE5YTIwMDc0ZmZiY2RjMzJmMjc1ZmZmMTE2YWUyOGM3MTIyMWMyNDk2MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.LOsYkt_2drz62MGzXCSwub_fAseDejjJzctzv1B813A)](https://private-user-images.githubusercontent.com/5711101/285511132-c0a6439b-cedb-49f7-8d1c-82762294f03a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzIyNzc0OTgsIm5iZiI6MTc3MjI3NzE5OCwicGF0aCI6Ii81NzExMTAxLzI4NTUxMTEzMi1jMGE2NDM5Yi1jZWRiLTQ5ZjctOGQxYy04Mjc2MjI5NGYwM2EucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDIyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAyMjhUMTExMzE4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2ExYThmZTg5NTczM2M2MTY4MDEzZWE5YTIwMDc0ZmZiY2RjMzJmMjc1ZmZmMTE2YWUyOGM3MTIyMWMyNDk2MyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.LOsYkt_2drz62MGzXCSwub_fAseDejjJzctzv1B813A)

### Invite Users to a Team

[](#invite-users-to-a-team)

[![](https://private-user-images.githubusercontent.com/5711101/285511068-dc52bf90-b0c2-46c1-b651-bf6a7b6d83e6.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1Y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lgtQW16LURhdGU9MjAyNjAyMjhUMTExMzE4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTIzMTJjMDI4YWQxMjJjYjc1NDVmOWQ4NzdhZmFkNDZhOTEzN2Q3NTU4ZTJmNmNlMjk1OWI5OGMyYzhiMjYwYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.g27kNwzkO2UCi6rovij_Iz1H5BpesSNgKwb2VFco3HU)

The invite members form has 2 ways to add members. You can search the existing application users and add them directly, or you can send an email invite to people outside of the platform. You can add as many email addresses as you want to the form, and each address will be emailed separately.

- The invite email uses the template in "/resources/views/emails/invite.blade.php".
- The registration link is expected to be a route named 'register' (`route('register')`).
- The emailed link includes a `token` query parameter that is set to the `$invite->token`.
    - If you wish, you may use this token to restrict registrations to *only* people with a valid invite.
    - By default, this restriction is not included in the package.
- Upon registering, the user is automatically added to any teams they have been invited to. This is done by matching their *email address* to any pending invites, so it is important for users to register using the email that the invite was sent to.
- By default, new users are team members, not admins. They can be given the admin role by an existing team or site admin.

### Invite Users to the whole site with a specific role

[](#invite-users-to-the-whole-site-with-a-specific-role)

You may also wish to invite users to your application without assigning them to a team. This package includes a "RoleInvite" model, migration and CrudController to let you manage this.

- To invite a new user, add a new Role Invite using the CrudController.
- After creating the invite, the email will be sent. The invite email uses the template in `/resources/views/emails/role_invite.blade.php`.
- Similar to a team invite:
    - the registration link is expected to be defined as a route named 'register' (`route('register')`),
    - it includes a `token` query parameter, which can be used to only allow registrations by people with a valid invite.
    - Upon registering, the user is automatically assigned the role from the Role Invite, which is done by matching their *email address* to any pending role invites.
- At present, you can only invite a single email address and assign a single role.
    - You can get around this limitation by sending multiple role invites - one for each role. However, this will result in multiple emails being sent, so it's probably better to invite a user with one role, then manually add other roles as required once they have registered.

Credits
-------

[](#credits)

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

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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

Unknown

Total

1

Last Release

1014d ago

### 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 (24 commits)")[![ciara-mc](https://avatars.githubusercontent.com/u/56551262?v=4)](https://github.com/ciara-mc "ciara-mc (9 commits)")

---

Tags

laravelstats4sdlaravel-team-management

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[ralphjsmit/livewire-urls

Get the previous and current url in Livewire.

82270.3k4](/packages/ralphjsmit-livewire-urls)[marcelweidum/filament-expiration-notice

Customize the livewire expiration notice

9169.0k4](/packages/marcelweidum-filament-expiration-notice)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[ziming/laravel-scrapingbee

A PHP Laravel Library for ScrapingBee

4310.6k](/packages/ziming-laravel-scrapingbee)

PHPackages © 2026

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