Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shihabudheen's avatar

Understanding Job and job table in Laravel?

I am using job in laravel5.1.

First I created one table job by running artisan command as follows.

php artisan queue:table php artisan queue:table

I have written job class as well,

php artisan make:job RecordAttendanceJob --queued class RecordAttendanceJob extends Job implements SelfHandling, ShouldQueue {



}

And I dispatch this from controller as follows and working fine,

$job = (new RecordAttendanceJob($attArray)); $this->dispatch($job);

Here my doubt is,

Why using that job table, I found always empty that job table?
What is the best way to notify success/failure of jobs to user later?
I found following method as well,Queue::push(new RecordAttendanceJob($attArray)) . What is the difference between this and about dispatch job? which is better method?

http://goo.gl/eu0vej

0 likes
1 reply
rodrigo.pedra's avatar

which queue driver are you using? It seems you are using the default sync driver, which will executes jobs synchronously and not actually use a queue.

In the SO link you linked in your post there is a comment from user KristofM which suggests reading this blog post: [ http://laravelcoding.com/blog/laravel-5-beauty-sending-mail-and-using-queues#14-about-queues ], it is worth reading.

Also there are great videos here at Laracasts about queues: [ https://laracasts.com/search?q=queue&q-where=lessons ]. One in particular I would recommend is this: [ https://laracasts.com/lessons/beanstalkd-queues-with-laravel ]

Please or to participate in this conversation.