1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 10:14:04 +00:00
This commit is contained in:
Samuel Štancl 2019-10-12 14:18:57 +02:00
parent e7aefe6c09
commit adc1b5e73e
2 changed files with 14 additions and 5 deletions

View file

@ -28,10 +28,12 @@ class InitializeTenancy
*/
public function handle($request, Closure $next)
{
try {
tenancy()->init($request->getHost());
} catch (TenantCouldNotBeIdentifiedException $e) {
($this->onFail)($e);
if (! in_array($request->getHost(), config('tenancy.exempt_domains', []), true)) {
try {
tenancy()->init($request->getHost());
} catch (TenantCouldNotBeIdentifiedException $e) {
($this->onFail)($e);
}
}
return $next($request);