Skip to content

Commit 27758f8

Browse files
committed
add ability to set console commands directory in ApplicationBuilder
1 parent 33424be commit 27758f8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Illuminate/Foundation/Configuration/ApplicationBuilder.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,15 @@ public function withMiddleware(?callable $callback = null)
266266
/**
267267
* Register additional Artisan commands with the application.
268268
*
269-
* @param array $commands
269+
* @param array|string $commands
270270
* @return $this
271271
*/
272-
public function withCommands(array $commands = [])
272+
public function withCommands(array|string $commands = [])
273273
{
274274
if (empty($commands)) {
275275
$commands = [$this->app->path('Console/Commands')];
276+
}elseif (is_string($commands)) {
277+
$commands = [$this->app->path($commands)];
276278
}
277279

278280
$this->app->afterResolving(ConsoleKernel::class, function ($kernel) use ($commands) {

0 commit comments

Comments
 (0)