From 1ff82fb2a09dd0ee545fd13679aa739ea589dfed Mon Sep 17 00:00:00 2001 From: bepsvpt <8221099+bepsvpt@users.noreply.github.com> Date: Tue, 18 Aug 2020 22:02:26 +0800 Subject: [PATCH] reverse middlewares order before prepend (#479) --- assets/TenancyServiceProvider.stub.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/TenancyServiceProvider.stub.php b/assets/TenancyServiceProvider.stub.php index 87c5c8141..1dc58a3d3 100644 --- a/assets/TenancyServiceProvider.stub.php +++ b/assets/TenancyServiceProvider.stub.php @@ -136,7 +136,7 @@ protected function makeTenancyMiddlewareHighestPriority() Middleware\InitializeTenancyByRequestData::class, ]; - foreach ($tenancyMiddleware as $middleware) { + foreach (array_reverse($tenancyMiddleware) as $middleware) { $this->app[\Illuminate\Contracts\Http\Kernel::class]->prependToMiddlewarePriority($middleware); } }