Just another multi tenant support package for Laravel. Heavily inspired from Mohamed Said multitenancy videos.
You can install the package via composer:
composer require binarcode/laravel-tenantable
Now lets setup it:
php artisan tenantable:setup
Let's say you have the App\Models\Organization
as a tenant model.
This model has to implement the BinarCode\Tenantable\Tenant\Contracts\Tenant
contract.
If you want to benefit of all the methods the contract as you to implement, just extends the BinarCode\Tenantable\Models\Tenant
class, and you don't have to add anything else in your model.
Now I'll take it step by step, since I was very confused when I implemented my firt multitenancy application.
You need 2 types of migrations, master
and tenant
. The migrations in the app\database\migrations
directory, are used for tenant
. If you have to add migrations for the master
use app\database\migrations\master
directory.
composer test
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
- spatie/laravel-multitenancy
- tenancy/tenancy
- stancl/tenancy
- gecche/laravel-multidomain
- romegadigital/multitenancy
The MIT License (MIT). Please see License File for more information.