How to save/redirect output from Laravel 5 Artisan command?
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.
I did this
php artisan your:command >> output.txt
worked fine for me.