We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33424be commit 27758f8Copy full SHA for 27758f8
src/Illuminate/Foundation/Configuration/ApplicationBuilder.php
@@ -266,13 +266,15 @@ public function withMiddleware(?callable $callback = null)
266
/**
267
* Register additional Artisan commands with the application.
268
*
269
- * @param array $commands
+ * @param array|string $commands
270
* @return $this
271
*/
272
- public function withCommands(array $commands = [])
+ public function withCommands(array|string $commands = [])
273
{
274
if (empty($commands)) {
275
$commands = [$this->app->path('Console/Commands')];
276
+ }elseif (is_string($commands)) {
277
+ $commands = [$this->app->path($commands)];
278
}
279
280
$this->app->afterResolving(ConsoleKernel::class, function ($kernel) use ($commands) {
0 commit comments