Skip to content

Commit 4c969f5

Browse files
authored
[13.x] Ensure DevCommands doesnt stop itself from registering (#60526)
* Update DevCommands.php * ensure only runs in console
1 parent 24a04d5 commit 4c969f5

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/Illuminate/Foundation/DevCommands.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,18 @@ class DevCommands
5252
*/
5353
public static function registerDefaults()
5454
{
55-
self::artisan('serve --host=localhost', 'server');
56-
self::artisan('queue:listen --tries=1 --timeout=0', 'queue');
57-
self::artisan('pail --timeout=0', 'logs');
58-
self::node('dev', 'vite');
55+
if (! app()->runningInConsole()) {
56+
return;
57+
}
58+
59+
foreach ([
60+
'server' => 'php artisan serve --host=localhost',
61+
'queue' => 'php artisan queue:listen --tries=1 --timeout=0',
62+
'logs' => 'php artisan pail --timeout=0',
63+
'vite' => self::getPackageManager()->getRunCommand('dev'),
64+
] as $name => $command) {
65+
self::$commands[$name] = new DevCommand($command, $name);
66+
}
5967
}
6068

6169
/**

0 commit comments

Comments
 (0)