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

optional for tenant()

This commit is contained in:
Samuel Štancl 2019-09-30 19:43:59 +02:00
parent e88801a4d1
commit 102ade4d8c

View file

@ -20,7 +20,7 @@ if (! \function_exists('tenant')) {
function tenant($key = null) function tenant($key = null)
{ {
if (! is_null($key)) { if (! is_null($key)) {
return app(Tenant::class)->get($key); return optional(app(Tenant::class))->get($key) ?? null;
} }
return app(Tenant::class); return app(Tenant::class);