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

phpstan fix

This commit is contained in:
Samuel Štancl 2024-04-03 19:51:07 +02:00
parent 47364007aa
commit 5ef7604e17

View file

@ -21,8 +21,11 @@ class Tinker extends BaseTinker
public function handle() public function handle()
{ {
// ?: to support empty strings so that the original argument (`include`) can be reached even with a falsy tenant argument // ?: to support empty strings so that the original argument (`include`) can be reached even with a falsy tenant argument
tenancy()->initialize($this->argument('tenant') ?: tenancy()->model()::first());
parent::handle(); /** @var \Stancl\Tenancy\Contracts\Tenant|string|int $tenantKey */
$tenantKey = $this->argument('tenant') ?: tenancy()->model()::first();
tenancy()->initialize($tenantKey);
return parent::handle();
} }
} }