Skip to content

Commit

Permalink
Auto-Register Commands in routes/console.php (#52867)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelNitsche authored Sep 22, 2024
1 parent b2a66a8 commit e216708
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ public function withMiddleware(?callable $callback = null)
*/
public function withCommands(array $commands = [])
{
if (empty($commands)) {
if (empty($commands) && is_file($this->app->basePath('routes/console.php'))) {
$commands = [$this->app->basePath('routes/console.php')];
}

if (empty($commands) && is_dir($this->app->path('Console/Commands'))) {
$commands = [$this->app->path('Console/Commands')];
}

Expand Down

0 comments on commit e216708

Please sign in to comment.