Get Artisan::output() while command still running

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

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *