From 170adae0cb1b0a4a8ec6bbb195e018443f924176 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Thu, 26 Sep 2024 19:08:42 +0800 Subject: [PATCH] [11.x] Revert auto-discovering `routes/console.php` as this will cause breaking change with the default `withRouting($console)` (#52942) * Revert "Fix for not automatically registering commands in App\Console\Commands (#52903)" This reverts commit d76b2f1553e17cf8968431d28d0b98750bffc7c1. * Revert "Auto-Register Commands in `routes/console.php` (#52867)" This reverts commit e216708d17f1b5f0b4de6ab81ff1f5c34c33488c. --- .../Foundation/Configuration/ApplicationBuilder.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php b/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php index a0f9754d9697..89ec3b9cc50f 100644 --- a/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php +++ b/src/Illuminate/Foundation/Configuration/ApplicationBuilder.php @@ -283,13 +283,7 @@ public function withMiddleware(?callable $callback = null) public function withCommands(array $commands = []) { if (empty($commands)) { - if (is_file($this->app->basePath('routes/console.php'))) { - $commands = [$this->app->basePath('routes/console.php')]; - } - - if (is_dir($this->app->path('Console/Commands'))) { - $commands = [...$commands, $this->app->path('Console/Commands')]; - } + $commands = [$this->app->path('Console/Commands')]; } $this->app->afterResolving(ConsoleKernel::class, function ($kernel) use ($commands) {