LaravelPackages.net
Acme Inc.
Toggle sidebar
binarcode/laravel-tenantable

Just another multi tenant support package for Laravel.

116.619
4
2.7.0
About binarcode/laravel-tenantable

binarcode/laravel-tenantable is a Laravel package for just another multi tenant support package for laravel.. It currently has 4 GitHub stars and 116.619 downloads on Packagist (latest version 2.7.0). Install it with composer require binarcode/laravel-tenantable. Discover more Laravel packages by binarcode or browse all Laravel packages to compare alternatives.

Last updated

Laravel Tenantable

Total Downloads Latest Stable Version License

Just another multi tenant support package for Laravel. Heavily inspired from Mohamed Said multitenancy videos.

Installation

You can install the package via composer:

composer require binarcode/laravel-tenantable

Now lets setup it:

php artisan tenantable:setup

Usage

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.

Migrations

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.

... See oficial documenation

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

Credits

The code of this package is based on the code shown in the Multitenancy in Laravel series by Mohamed Said

Alternatives

License

The MIT License (MIT). Please see License File for more information.

Star History Chart