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

Don't accept closures in tenant() helper

This commit is contained in:
Samuel Štancl 2019-12-03 22:52:30 +01:00 committed by GitHub
parent 9851f088ea
commit f99ecb72c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,7 @@ if (! function_exists('tenant')) {
/**
* Get a key from the current tenant's storage.
*
* @param string|Closure|null $key
* @param string|null $key
* @return Tenant|mixed
*/
function tenant($key = null)
@ -30,10 +30,6 @@ if (! function_exists('tenant')) {
return app(Tenant::class);
}
if ($key instanceof Closure) {
return app(Tenant::class)->run($key);
}
return optional(app(Tenant::class))->get($key) ?? null;
}
}