simple-tenancy:Laravel应用程序的简单多租户

时间:2021-05-09 11:54:26
【文件属性】:
文件名称:simple-tenancy:Laravel应用程序的简单多租户
文件大小:11KB
文件格式:ZIP
更新时间:2021-05-09 11:54:26
laravel multi-tenancy hacktoberfest PHP 简单的Laravel多租户 简单租户将自动多租户支持添加到存储在共享数据库中的Eloquent模型中。 在大多数情况下,它依赖于已建立的Laravel约定,并且需要零配置,并且每个表上只有一列。 这个怎么运作 在引擎盖下,它只有4个组件: Tenant :跟踪当前用户 HasTenancy :属于租户的模型的特征,该特征注册: TenancyScope :一个将所有模型的查询限制到当前租户 TenancyObserver :一个,用于在保存时设置当前的租户列/标识符 默认情况下,租户是Laravel的Auth::user() ,并且在没有人通过身份验证时,所有租户检查都将被禁用。 安装 使用Composer安装: composer require sbine/simple-tenancy 将HasTenancy特性添加到属于该租户的所有模型中: class Account e
【文件预览】:
simple-tenancy-main
----.gitignore(22B)
----src()
--------SuperAdmin.php(189B)
--------TenancyScope.php(675B)
--------HasTenancy.php(294B)
--------TenancyProvider.php(789B)
--------Tenant.php(1000B)
--------TenancyObserver.php(314B)
----LICENSE.md(1KB)
----composer.json(992B)
----.github()
--------workflows()
----README.md(3KB)
----tests()
--------TenantTest.php(1KB)
--------TestCase.php(277B)
--------TenancyObserverTest.php(1KB)
--------Stubs()
--------TenancyProviderTest.php(886B)
--------TenancyScopeTest.php(1KB)
----phpunit.xml.dist(696B)

网友评论