mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:04:02 +00:00
Add static variable for MiddlewareUniversalName. (#581)
* Added middlewareUniversalName static variable to extends and customize the UniversalRoutes class * change the variable name and undo the code style
This commit is contained in:
parent
04193cc2fd
commit
1a48725aef
1 changed files with 3 additions and 1 deletions
|
|
@ -13,6 +13,8 @@ use Stancl\Tenancy\Tenancy;
|
|||
|
||||
class UniversalRoutes implements Feature
|
||||
{
|
||||
public static $middlewareGroup = 'universal';
|
||||
|
||||
public static $identificationMiddlewares = [
|
||||
Middleware\InitializeTenancyByDomain::class,
|
||||
Middleware\InitializeTenancyBySubdomain::class,
|
||||
|
|
@ -22,7 +24,7 @@ class UniversalRoutes implements Feature
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue