1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 02:04:03 +00:00

Storage drivers WIP

This commit is contained in:
Samuel Štancl 2019-09-11 14:32:13 +02:00
parent 7eba041509
commit 69db512d30
6 changed files with 128 additions and 49 deletions

View file

@ -2,13 +2,14 @@
declare(strict_types=1);
use Stancl\Tenancy\Tenant;
use Stancl\Tenancy\TenantManager;
if (! \function_exists('tenancy')) {
function tenancy($key = null)
{
if ($key) {
return app(TenantManager::class)->tenant[$key] ?? null;
return app(TenantManager::class)->getTenant($key) ?? null;
}
return app(TenantManager::class);
@ -18,7 +19,9 @@ if (! \function_exists('tenancy')) {
if (! \function_exists('tenant')) {
function tenant($key = null)
{
return tenancy($key);
if (! is_null($key)) {
return app(Tenant::class)->get($key);
}
}
}