diff --git a/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php b/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php index de5898797c95..0ee659a25055 100644 --- a/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php +++ b/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php @@ -274,9 +274,7 @@ public function withCommands(array $commands = []) protected function withCommandRouting(array $paths) { $this->app->afterResolving(ConsoleKernel::class, function ($kernel) use ($paths) { - $this->app->booted(function () use ($kernel, $paths) { - $kernel->addCommandRoutePaths($paths); - }); + $this->app->booted(fn () => $kernel->addCommandRoutePaths($paths)); }); }