diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index b76bbf38..f8f6d40f 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -7,6 +7,7 @@ use Illuminate\Support\Collection; use Illuminate\Contracts\Http\Kernel; use Illuminate\Support\Facades\Blade; +use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\Session; use Illuminate\Support\ServiceProvider as BaseServiceProvider; @@ -51,7 +52,10 @@ protected function registerRouterMacro() protected function registerMiddleware() { - $this->app[Kernel::class]->pushMiddleware(Middleware::class); + $this->app[Kernel::class]->appendMiddlewareToGroup( + Config::get('inertia.middleware_group', 'web'), + Middleware::class + ); } protected function shareValidationErrors()