Laravel Jetstream: Teams and API Tokens at Install
A decision guide for Laravel Jetstream: whether to enable Teams and Sanctum API tokens at install time, compare Livewire vs Inertia stacks, understand trade‑offs, and validate the configuration end‑to‑end.
27 Dec 2025, 21:30 UTC

The Install-Time Decision
When initializing a new project with Laravel Jetstream, you must decide early whether to enable Teams and API‑token support. Both features are opt‑in flags during jetstream:install; enabling them scaffolds models, migrations, and UI, while omitting them means adding multi‑tenancy later through manual refactoring.
Feature Comparison
| Feature | Included | Impact |
|---|---|---|
| Teams | Team model, invitations, team‑switcher UI, role‑based permissions | Adds current_team_id to users; middleware for team‑scoped routes |
| API Tokens | Sanctum‑backed UI for personal access tokens | Required for mobile or third‑party integrations |
| Livewire | Blade components with PHP logic | Keeps logic in PHP; minimal JavaScript build step |
| Inertia | Vue or React single‑page front end | Requires Node.js tooling; app‑like UI feel |
Trade‑offs
- Teams up front: Adds schema, middleware, and UI you may never exercise, but retrofitting team scoping onto existing queries, policies, and routes is usually more invasive than starting with it.
- Teams later: Requires modifying the User model, updating every database query with a
where('team_id', ...)clause, and re‑scaffolding or hand‑building the team‑switching and invitation interfaces. - Livewire vs Inertia: Livewire keeps logic in PHP and reduces front‑end tooling; Inertia suits teams already fluent in Vue or React and gives a more app‑like feel. Switching stacks later is costly because views, components, and routing differ.
Concrete Installation
To install Jetstream with Teams and API‑token support using the Livewire stack, run the following command in your project root (assuming Laravel is already installed via Composer):
php artisan jetstream:install livewire --teams --api-tokensAfter scaffolding completes, run migrations to create the necessary tables:
php artisan migrate
Validating the Teams Configuration
- Register a User: Navigate to
/registerand create a new account. - Create a Team: Go to the Team menu and create a new team. Verify you are assigned as the Owner.
- Invite a Member: Use the invitation feature to invite a second email address.
- Switch Context: Use the team switcher to toggle between accounts. Verify that the
current_team_idin your session updates. - Test Role Gating: Change the invited member's role to Viewer and attempt to access an action restricted to Administrators via your application's custom policies.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.