Skip to content

Commit 516c7b9

Browse files
authored
Merge pull request #172 from Sairahcaz/main
fix: defer InjectBoost middleware registration until app is booted
2 parents e61a894 + 21e4280 commit 516c7b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BoostServiceProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ private static function mapJsTypeToPsr3Level(string $type): string
180180

181181
private function hookIntoResponses(Router $router): void
182182
{
183-
$router->pushMiddlewareToGroup('web', InjectBoost::class);
183+
$this->app->booted(function () use ($router) {
184+
$router->pushMiddlewareToGroup('web', InjectBoost::class);
185+
});
184186
}
185187

186188
private function shouldRun(): bool

0 commit comments

Comments
 (0)