mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 05:14: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,6 +23,7 @@ class UniversalRoutes implements Feature
|
|||
public function bootstrap(Tenancy $tenancy): void
|
||||
{
|
||||
foreach (static::$identificationMiddlewares as $middleware) {
|
||||
if (is_null($middleware::$onFail)) {
|
||||
$middleware::$onFail = function ($exception, $request, $next) {
|
||||
if (static::routeHasMiddleware($request->route(), static::$middlewareGroup)) {
|
||||
return $next($request);
|
||||
|
|
@ -32,6 +33,7 @@ class UniversalRoutes implements Feature
|
|||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function routeHasMiddleware(Route $route, $middleware): bool
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue