Download the PHP package solutosoft/yii-multitenant without Composer
On this page you can find all versions of the php package solutosoft/yii-multitenant. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download solutosoft/yii-multitenant
More information about solutosoft/yii-multitenant
Files in solutosoft/yii-multitenant
Download solutosoft/yii-multitenant
More information about solutosoft/yii-multitenant
Files in solutosoft/yii-multitenant
Vendor solutosoft
Package yii-multitenant
Short Description The shared database used by all tenants
License BSD-3-Clause
Homepage https://gitlab.com/solutosoft/yii2-base
Package yii-multitenant
Short Description The shared database used by all tenants
License BSD-3-Clause
Homepage https://gitlab.com/solutosoft/yii2-base
Please rate this library. Is it a good library?
Informations about the package yii-multitenant
Active Record MultiTenant Extension
This extension provides support for ActiveRecord MultiTenant.
Installation
The preferred way to install this extension is through composer.
Either run
or add
Usage
-
Creates table with
tenant_id
column: -
Adds
TenantInterface
to user model: - Extends models with
tenant_id
attribute fromMultiTenantRecord
intead ofActiveRecord
:
Now when you save or execute some query the tenant_id
column will be used. Example:
// It's necessary the user will be logged in
$posts = \app\models\Post::find()->where(['category_id' => 1])->all();
// SELECT * FROM `post` WHERE `category_id` = 1 and `tenant_id` = 1;
$category = \app\models\Category([
'name' => 'framework'
]);
$category->save();
// INSERT INTO `category` (`name`, `tenant_id`) values ('framework', 1);
All versions of yii-multitenant with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
~2.0.16
The package solutosoft/yii-multitenant contains the following files
Loading the files please wait ....