Skip to content

Commit

Permalink
fix: Fix for a phpstan error
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Jan 27, 2025
1 parent c82761f commit 80e603b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Http/Middleware/TenantRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,18 @@ public function handle(Request $request, Closure $next, string ...$options): Res
}

if (! $this->sprout->hasCurrentTenancy() || ! $this->sprout->getCurrentTenancy()?->check()) {
throw NoTenantFoundException::make($resolverName, $tenancyName);
$defaultResolver = config('multitenancy.defaults.resolver');
$defaultTenancy = config('multitenancy.defaults.tenancy');

/**
* @var string $defaultResolver
* @var string $defaultTenancy
*/

throw NoTenantFoundException::make(
$resolverName ?? $defaultResolver,
$tenancyName ?? $defaultTenancy
);
}

return $next($request);
Expand Down

0 comments on commit 80e603b

Please sign in to comment.