Download the PHP package lukapeharda/multitenancy without Composer
On this page you can find all versions of the php package lukapeharda/multitenancy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lukapeharda/multitenancy
More information about lukapeharda/multitenancy
Files in lukapeharda/multitenancy
Package multitenancy
Short Description A single DB multitenancy package for Laravel based on subdomain routing.
License MIT
Informations about the package multitenancy
MultiTenancy
Introduction
MultiTenancy is a Laravel single DB multitenancy package based on subdomain routing.
Installation
Require this package, with Composer, in the root directory of your project.
Add the service provider to config/app.php
in the providers
array.
Publish the config file and modify its params to fit your needs and installation.
Usage
Add the LukaPeharda\MultiTenancy\Scopes\Contextable
trait to your models that are "tenant" dependable. This trait will automatically load global scope which will filter all your queries by defined tenant key.
Beside adding trait to your models, your model DB schema needs to have the tenant key as its attribute (and most likely as its foreign key).
To disable tenant global scope use withoutGlobalScope
builder method:
Fetching the current tenant (and all of its attributes) is available through helper function context
.
License
MultiTenancy is open-sourced software licensed under the MIT license
All versions of multitenancy with dependencies
illuminate/http Version ~5.3
illuminate/support Version ~5.3
illuminate/database Version ~5.3