I\'m using Artisan::call() in one of my routes and would like to save the command output to a variable.
Artisan::call()
Is there any way to capture the STDOUT and STDER
This is a way:
use Symfony\Component\Console\Output\BufferedOutput; Route::get('/test', function() { $output = new BufferedOutput; Artisan::call('list', array(), $output); return $output->fetch(); });