This package can make a Laravel app tenant aware. The philosophy of this package is that it should only provide the bare essentials to enable multitenancy.
The package can determine which tenant should be the current tenant for the request. It also allows you to define what should happen when switching the current tenant to another one. It works for multitenancy projects that need to use one or multiple databases.
Before starting with the package, we highly recommend first watching this talk by Tom Schlick on multitenancy strategies.
The package contains a lot of niceties such as making queued jobs tenant aware, making an artisan command run for each tenant, an easy way to set a connection on a model, and much more.
Are you a visual learner? Then watch this video that covers how you can use laravel-multitenancy and how it works under the hood.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
You can find the entire documentation for this package on our documentation site.
You'll need to create the following 3 local MySql databases to be able to run the test suite:
You can run the package's tests:
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The code of this package is based on the code shown in the Multitenancy in Laravel series by Mohamed Said
The MIT License (MIT). Please see License File for more information.