---
title: "Installation — Teams for Laravel | Roundly"
description: "Install via Composer, publish and run the teams migrations plus those of the five sibling packages, and optionally publish config and stubs."
url: https://roundly-consulting.com/open-source/docs/teams-for-laravel/installation
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Teams for Laravel](https://roundly-consulting.com/open-source/docs/teams-for-laravel.md)

# Installation

Require the package, then publish and run its migrations — and those of the Roundly packages it builds on. The service provider and the Teams facade alias are auto-discovered:

```bash
composer require roundly-consulting/teams-for-laravel

php artisan vendor:publish --tag="options-migrations"
php artisan vendor:publish --tag="contacts-migrations"
php artisan vendor:publish --tag="addresses-migrations"
php artisan vendor:publish --tag="connections-migrations"
php artisan vendor:publish --tag="approvals-migrations"
php artisan vendor:publish --tag="teams-migrations"
php artisan migrate
```

Publishing is required — none of these packages load their migrations themselves, so a bare php artisan migrate creates no tables. The six teams migrations publish timestamp-injected and in dependency order (teams first, then the tables whose foreign keys reference it), so they order correctly against your own. Republishing lands on the same files, so --force overwrites in place. Migrations only migrate forward: rolling them back leaves the tables in place.

## Why the sibling migrations

Teams reads its per-team settings — join policy, seat cap, default role — from options-for-laravel on every member add and join request, so the options table is needed from the very first Teams::create(). The contacts, addresses, connections and approvals tables back Teams::for($team)->contacts(), ->addresses(), ->connections() and the governed join-request sign-off — see Integrations.

## Optional publishing

```bash
php artisan vendor:publish --tag="teams-config"         # config/teams.php
php artisan vendor:publish --tag="teams-translations"   # error messages
php artisan vendor:publish --tag="teams-stubs"          # controller, routes, subscriber, Pest file
```

| Tag | Publishes | Lands at |
| --- | --- | --- |
| `teams-migrations` | The six migrations (required) | `database/migrations/` |
| `teams-config` | config/teams.php | `config/teams.php` |
| `teams-translations` | Error messages (English and Slovak) | `lang/vendor/teams/` |
| `teams-stubs` | AcceptInviteController | `app/Http/Controllers/AcceptInviteController.php` |
| `teams-stubs` | Accept-invite route | `routes/teams.php` |
| `teams-stubs` | TeamEventSubscriber | `app/Listeners/TeamEventSubscriber.php` |
| `teams-stubs` | Pest matchers bootstrap | `tests/Teams.php` |

## Before your first team

- Members with UUID or ULID keys? Set TEAMS\_KEY\_TYPE before you migrate — see Configuration.
- Add the HasTeams trait to your user model — see Model traits.
- Register your roles in a service provider, including the owner, admin and member keys the package assigns by default — see Roles.

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/teams-for-laravel.md)
