mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 23:54:03 +00:00
bug: added null check on middleware onFail in UniversalRoutes
This commit is contained in:
parent
4dab0c1870
commit
89be25a3af
1 changed files with 8 additions and 6 deletions
|
|
@ -23,13 +23,15 @@ class UniversalRoutes implements Feature
|
|||
public function bootstrap(Tenancy $tenancy): void
|
||||
{
|
||||
foreach (static::$identificationMiddlewares as $middleware) {
|
||||
$middleware::$onFail = function ($exception, $request, $next) {
|
||||
if (static::routeHasMiddleware($request->route(), static::$middlewareGroup)) {
|
||||
return $next($request);
|
||||
}
|
||||
if (is_null($middleware::$onFail)) {
|
||||
$middleware::$onFail = function ($exception, $request, $next) {
|
||||
if (static::routeHasMiddleware($request->route(), static::$middlewareGroup)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
throw $exception;
|
||||
};
|
||||
throw $exception;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue