Skip to content

Commit

Permalink
Add static variable for MiddlewareUniversalName. (archtechx#581)
Browse files Browse the repository at this point in the history
* Added middlewareUniversalName static variable to extends and customize the UniversalRoutes class

* change the variable name and undo the code style
  • Loading branch information
mlajx authored Jan 15, 2021
1 parent 04193cc commit 1a48725
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Features/UniversalRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

class UniversalRoutes implements Feature
{
public static $middlewareGroup = 'universal';

public static $identificationMiddlewares = [
Middleware\InitializeTenancyByDomain::class,
Middleware\InitializeTenancyBySubdomain::class,
Expand All @@ -22,7 +24,7 @@ public function bootstrap(Tenancy $tenancy): void
{
foreach (static::$identificationMiddlewares as $middleware) {
$middleware::$onFail = function ($exception, $request, $next) {
if (static::routeHasMiddleware($request->route(), 'universal')) {
if (static::routeHasMiddleware($request->route(), static::$middlewareGroup)) {
return $next($request);
}

Expand Down

0 comments on commit 1a48725

Please sign in to comment.