Hey there,
I have the same problem right now and didn't find a simple technique built in Laravel 5.2 which would solve it right away. Nevertheless, I have this (somehow inconvenient) idea how a user can get notified of the progress of queue jobs by connecting well known Laravel-features.
- Create a table in your database for your Queue Jobs (id, description, user_id, progress, created_at, updated_at). Or create your own fields. Whatever makes sense to you.
- Right before a job is pushed to the Queue (e.g. from your Controller), create a new table entry for a Queue Job and set the corresponding fields as stated above and save the corresponding id. Set the progress to "received", "waiting", 0 or anything you can imagine as a progress status to begin with.
- Push the job to the Queue and give the job the id received before and the user_id from the user who triggered the job.
- Inside a Job 's handle-method you should fire an Event like JobProgressHasChanged whenever you want to inform the system of a progress update and give JobProgressHasChanged the updated fields as parameters.
- The JobProgressHasChangedListener receives the event and updates the entry in the Queue Jobs table.
Now comes the part where you can implement anything you want to inform the user of the progress of his jobs. You can implement a Controller whose whole purpose is to provide a route the user can contact by an Ajax-Request every second. The route would produce a list in Json-format from the users's Jobs out of the Queue Jobs table.
I know that polling the status of one's jobs is not an elegant thing. The other option is covered right here: https://laracasts.com/lessons/broadcasting-events-in-laravel-5-1
The solution involving Pusher seems to be a much better approach here.
with kind regards, Christoph