Get Artisan::output() while command still running

  artisan, laravel, php, symfony

I have a route /sync which it calls an Artisan::call('product:sync');

 Route::get('/sync', function (Request $request) {
      Artisan::call('product:sync');
     return (Artisan::output());

  });

It shows output but after command finished. Now since command takes long to finish I need to display

$this->info('Welcome to Product Sync!');

info from command in a view. I am not sure if I need separate route to check Artisan::output() with an ajax call ?

Anything that help imitate terminal would help.

Source: Symfony Questions

LEAVE A COMMENT