Laravel Jetstream isn't officially presented as a multi-tenancy package. But looking at the things that we have already done in this course, Jetstream does a similar thing helping us to divide users by teams as one of its features.
The Teams feature includes member management, invitations, roles and permissions, inspecting current teams, and other functions. Let's briefly cover how it works and how Jetstream can help us with multi-tenancy.
Jetstream Installation
Jetstream should only be installed in a new Laravel project. Jetstream offers two frontend stacks: Livewire and Inertia.js. We will be using the Livewire stack. Jetstream can be installed in several ways. One of the ways is to provide options for a Laravel installer.
laravel new tenancy --jet --stack=livewire --teams
After registering, in the navigation we can see a dropdown for managing a team.
In the Team Settings
page, we can change the team's name and invite new members to the team. It's similar to what we have done previously with team invitations.
We can create a new team and switch between teams.
The users
table in the database has a current_team_id
column.
Again, it's very similar to what we have done earlier.
The whole team management and all of that stuff is done partly...