File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,13 @@ private static function mapJsTypeToPsr3Level(string $type): string
180180
181181 private function hookIntoResponses (Router $ router ): void
182182 {
183- $ router ->pushMiddlewareToGroup ('web ' , InjectBoost::class);
183+ // In Kernel-based apps (pre-Laravel 11 bootstrap), middleware groups can be
184+ // defined or overwritten later in the boot cycle, which could remove any
185+ // middleware we push here if we do it too early. Deferring this until the
186+ // application is fully booted ensures our middleware stays appended.
187+ $ this ->app ->booted (function () use ($ router ) {
188+ $ router ->pushMiddlewareToGroup ('web ' , InjectBoost::class);
189+ });
184190 }
185191
186192 private function shouldRun (): bool
You can’t perform that action at this time.
0 commit comments