Skip to content

Commit 9a9fd4d

Browse files
committed
Add the ability to configure the Inertia middleware group
1 parent 12600e2 commit 9a9fd4d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\Collection;
88
use Illuminate\Contracts\Http\Kernel;
99
use Illuminate\Support\Facades\Blade;
10+
use Illuminate\Support\Facades\Config;
1011
use Illuminate\Support\Facades\Session;
1112
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
1213

@@ -51,7 +52,10 @@ protected function registerRouterMacro()
5152

5253
protected function registerMiddleware()
5354
{
54-
$this->app[Kernel::class]->appendMiddlewareToGroup('web', Middleware::class);
55+
$this->app[Kernel::class]->appendMiddlewareToGroup(
56+
Config::get('inertia.middleware_group', 'web'),
57+
Middleware::class
58+
);
5559
}
5660

5761
protected function shareValidationErrors()

0 commit comments

Comments
 (0)