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

Bootstrapper tests

This commit is contained in:
Samuel Štancl 2020-05-11 03:37:47 +02:00
parent 73fc525126
commit 6f4b9f486c
20 changed files with 266 additions and 79 deletions

View file

@ -2,8 +2,8 @@
declare(strict_types=1);
use Stancl\Tenancy\Database\Models\Tenant;
use Stancl\Tenancy\Tenancy;
use Stancl\Tenancy\Contracts\Tenant;
if (! function_exists('tenancy')) {
/** @return Tenancy */
@ -18,10 +18,14 @@ if (! function_exists('tenant')) {
* Get a key from the current tenant's storage.
*
* @param string|null $key
* @return Tenant|mixed
* @return Tenant|null|mixed
*/
function tenant($key = null)
{
if (! app()->bound(Tenant::class)) {
return null;
}
if (is_null($key)) {
return app(Tenant::class);
}