PHPackages                             tamunoemi/teamwork - 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. tamunoemi/teamwork

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

tamunoemi/teamwork
==================

Forked from https://github.com/mpociot/teamwork to support laravel 12

1.0.0(1y ago)0129MITPHPPHP ^8.0CI passing

Since Apr 1Pushed 1y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (2)Used By (0)

Teamwork
========

[](#teamwork)

This package supports Laravel 6 and above.

[![Latest Version](https://camo.githubusercontent.com/cc1d1c5316d621ee747659e2c3f960e6522089f0e9323b40ca3e0ce225d181b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d706f63696f742f7465616d776f726b2e737667)](https://github.com/mpociot/teamwork/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://github.com/mpociot/teamwork/workflows/run-tests/badge.svg)](https://github.com/mpociot/teamwork/workflows/run-tests/badge.svg)[![codecov.io](https://camo.githubusercontent.com/092a2f19a99ccc2d9003a46737fdcc3ea9424d67881d570ce76b0ff88d23a50f/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d706f63696f742f7465616d776f726b2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/mpociot/teamwork?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/c41ab05f2e10d3f16bd7d161548d60e1cbfb9fa88a544d1cbb9bd2cb2814d305/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61326132366535352d626663372d343961392d393333622d3732636137633234353033342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/a2a26e55-bfc7-49a9-933b-72ca7c245034)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6a4fa89ae067cd4bd0e99522e1ef3b88103f252e144ed3cd612c3eff875e6397/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d706f63696f742f7465616d776f726b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mpociot/teamwork/?branch=master)

Teamwork is the fastest and easiest method to add a User / Team association with Invites to your **Laravel 6+** project.

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

[](#installation)

```
composer require mpociot/teamwork

```

The `Teamwork` Facade will be discovered by Laravel automatically.

Configuration
-------------

[](#configuration)

To publish Teamwork's configuration and migration files, run the `vendor:publish` command.

```
php artisan vendor:publish --provider="Mpociot\Teamwork\TeamworkServiceProvider"
```

This will create a `teamwork.php` in your config directory. The default configuration should work just fine for you, but you can take a look at it, if you want to customize the table / model names Teamwork will use.

### User relation to teams

[](#user-relation-to-teams)

Run the `migration` command, to generate all tables needed for Teamwork. **If your users are stored in a different table other than `users` be sure to modify the published migration.**

```
php artisan migrate
```

After the migration, 3 new tables will be created:

- teams — stores team records
- team\_user — stores [many-to-many](http://laravel.com/docs/5.1/eloquent-relationships#many-to-many) relations between users and teams
- team\_invites — stores pending invites for email addresses to teams

You will also notice that a new column `current_team_id` has been added to your users table. This column will define the Team, the user is currently assigned to.

### Models

[](#models)

#### Team

[](#team)

Create a Team model inside `app/Team.php` using the following example:

```
