Skip to content

Commit 51647eb

Browse files
committed
return pending dispatch for artisan::queue
1 parent 01fdf25 commit 51647eb

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Illuminate/Contracts/Console/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function call($command, array $parameters = []);
2727
*
2828
* @param string $command
2929
* @param array $parameters
30-
* @return int
30+
* @return \Illuminate\Foundation\Bus\PendingDispatch
3131
*/
3232
public function queue($command, array $parameters = []);
3333

src/Illuminate/Foundation/Console/Kernel.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,11 @@ public function call($command, array $parameters = [], $outputBuffer = null)
226226
*
227227
* @param string $command
228228
* @param array $parameters
229-
* @return void
229+
* @return \Illuminate\Foundation\Bus\PendingDispatch
230230
*/
231231
public function queue($command, array $parameters = [])
232232
{
233-
$this->app[QueueContract::class]->push(
234-
new QueuedCommand(func_get_args())
235-
);
233+
return QueuedCommand::dispatch(func_get_args());
236234
}
237235

238236
/**

src/Illuminate/Foundation/Console/QueuedCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
namespace Illuminate\Foundation\Console;
44

5+
use Illuminate\Bus\Queueable;
6+
use Illuminate\Foundation\Bus\Dispatchable;
57
use Illuminate\Contracts\Queue\ShouldQueue;
68
use Illuminate\Contracts\Console\Kernel as KernelContract;
79

810
class QueuedCommand implements ShouldQueue
911
{
12+
use Dispatchable, Queueable;
13+
1014
/**
1115
* The data to pass to the Artisan command.
1216
*

0 commit comments

Comments
 (0)