Skip to content

Commit

Permalink
[11.x] Revert auto-discovering routes/console.php as this will caus…
Browse files Browse the repository at this point in the history
…e breaking change with the default `withRouting($console)` (#52942)

* Revert "Fix for not automatically registering commands in App\Console\Commands (#52903)"

This reverts commit d76b2f1.

* Revert "Auto-Register Commands in `routes/console.php` (#52867)"

This reverts commit e216708.
  • Loading branch information
crynobone authored Sep 26, 2024
1 parent 296f3f8 commit 170adae
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 170adae

Please sign in to comment.