Aug 11, 2015
0
Level 1
Output from Artisan::call() in Laravel 5
In L4, you could do something like this to call an Artisan command from within your code and have its output sent to stdout:
$stream = fopen('php://stdout', 'w');
$output = new \Symfony\Component\Console\Output\StreamOutput($stream);
Artisan::call('the:command', $args, $output);
This doesn't work in L5. It seems that the 'call' method's signature has changed from this:
public function call($command, array $parameters = array(), OutputInterface $output = null)
to this:
public function call($command, array $parameters = [])
Which is a ~~massive~~ bit of a shame. Anyone know of a way to get at the output of called Artisan commands now? Is this a feature that's been removed or am I missing a sneaky way to do it?
Please or to participate in this conversation.