How to save/redirect output from Laravel 5 Artisan command?

laravel, laravel-5, laravel-artisan, php

Solution

I managed to get this to work using `Artisan::output()`, which returns the output of the latest command.

Route::get('/test', function()
{    
    Artisan::call('testCommand', array());

    return Artisan::output();
});

should do it for you.

Problem

I have tried the method described here but this doesn't work on my Laravel 5 installation. ``` use Symfony\Component\Console\Output\BufferedOutput; Route::get('/test', function() { $output = new BufferedOutput; Artisan::call('testCommand', array(), $output); return $output->fetch(); }); ``` My command; ``` public function fire() { $this->info('No output visible'); } ``` Any suggestions what I might do wrong? Or is it something that has changed in Laravel 5?

Original source

Related problems