Skip to content

Commit

Permalink
Check web middleware (#1712)
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh authored Dec 30, 2024
1 parent a053847 commit 9d43c6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@ protected function getConfigPath()
*/
protected function registerMiddleware($middleware)
{
/** @var \Illuminate\Foundation\Http\Kernel $kernel */
$kernel = $this->app[Kernel::class];
$kernel->pushMiddleware($middleware);
$kernel->appendMiddlewareToGroup('web', $middleware);
if (isset($kernel->getMiddlewareGroups()['web'])) {
$kernel->appendMiddlewareToGroup('web', $middleware);
}
}
}

0 comments on commit 9d43c6a

Please sign in to comment.