miracuthbert / laravel-multi-tenancy
A single database and multi-database multi-tenancy package for Laravel 5.8 and up
Package info
github.com/miracuthbert/laravel-multi-tenancy
pkg:composer/miracuthbert/laravel-multi-tenancy
Requires
- php: ^7.3|^8.0
- illuminate/console: >=6.0
- illuminate/database: >=6.0
- illuminate/events: >=6.0
- illuminate/support: >=6.0
- webpatser/laravel-uuid: >=3.0
Requires (Dev)
- laravel/legacy-factories: >=1.0.4
- orchestra/testbench: >=4.0
- phpunit/phpunit: >=8.5
This package is auto-updated.
Last update: 2026-05-26 19:48:27 UTC
README
A single database and multi-database multi-tenancy package for Laravel 5.8 and up.
For the full installation, configuration and usage, see the Documentation.
Installation
You can install the package via composer:
composer require miracuthbert/laravel-multi-tenancy
Setup
The package takes advantage of Laravel Auto-Discovery, so it doesn't require you to manually add the ServiceProvider.
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
Miracuthbert\Multitenancy\LaravelMultiTenancyServiceProvider::class
Run the following command in your console: php artisan tenancy:setup
This will setup:
- The package config file
- The tenant routes file
- TenantDatabaseSeeder (by default used only by the
multidriver) - Plus a tenant
modelandmigrationfile if you passed a model name to the--modeloption. See below for more.
You need to setup some of the required keys first in the
config/tenancy.phpfile before migrating the database
See the Documentation.
Security Vulnerabilities
If you discover a security vulnerability, please send an e-mail to Cuthbert Mirambo via miracuthbert@gmail.com. All security vulnerabilities will be promptly addressed.
Credits
License
Laravel Multi-Tenancy is licensed under GPL-3.0-only. Please see the license file for more information.