This is a pretty nice video when you see that there are lot of other not so good Indian tutorials out there (please no offence) that explain in this detail
Awsome video series but with this one I ran into an issue : ShouldQueue does not work for me. All the listeners do their tasks but when I add ShouldQueue all works identically the same as before. So the timer waits for 10 seconds and the mail coms into mailtrap. Nothing is added to my jobs table, but since there is a jobtable migrations have worked. I have changed my driver to database in the ENV file and I am using sqlite just as in your tutorial. I'm working on windows 10 with composer and installed nodejs package for the npm etc. as you have shown in previous videos of this series. Restaring php artisan server did not change anything. Running the same laravel with wamp running and php artisan server off had the identical result of skipping the Queue entirely. Any other suggestions I can try to make it work as intended?
stop the server, then clear cache - php artisan config:cache then restart the server. anything that affects the .env file needs some cache clearing and restarting the server. that should work
Hi Coder's tape, great series ever. I have one error for jobs lecture [2019-12-23 12:28:34][22] Processing: App\Listeners\WelcomeNewCustomerListener [2019-12-23 12:28:34][22] Failed: App\Listeners\WelcomeNewCustomerListener i tried 22 times but it showing only this error again and again. Please tell me how to fix this.
I can't thank you enough for the great course. I have a question: Can we control the order of listener handlers e.g (chain them based on their return results)?
No but you can always fire new events in your listener to trigger other listeners. For example, you fire an event of GenerateBlahReportEvent, then you are calculating a big report and it takes 3 minutes to run the job. After you are done, you fire, ReportBlahHasCompletedEvent and it has its own set of listeners send an email for example.
Why not just reply to his comment. Making a new comment does nothing for him unless he goes through the comments manually. Replying sends him a notification.
The difference between an event and a job is that you can listen for an event and trigger certain tasks. So for example, Laravel actually fires many events internally and technically nothing happens. But you have the option to hook into those events and add your own logic. As a concrete example of that, Laravel fires events when saving, retrieving or updating records from the database. If you needed to perform something before inserting a record, you can listen for a saving event on the model and add that in. You can also fire your own custom events of course and optionally add listeners. This type of functionality is just not possible with jobs. Jobs are designed more for things like cron tasks. As an example of this, in one of my apps, I send a daily email at 9pm with a summary of that day's transactions. This is a job called DailyReportJob. There is no action (event) associated with this task, meaning that it's not tied into a specific event occurring in my app, so it's a job. Hope that clarifies it.
I have a question everyone , does queue database work in production ? all my notitifications fails when i use queue:work :( on local everything is working like a charm.
Nvm found out how. Guys you can download tableplus, open app and click sqlite, then a window pops up saying enter name and select db. select DB opens up finder and is looking for a file. Go into your project root/database and click database.sqlite this should connect and you should see the databases
I have this issue when i put php artisan queue:work [2019-09-22 22:55:01][7] Processing: App\Listeners\WelcomeNewStudentListener [2019-09-22 22:55:01][7] Failed: App\Listeners\WelcomeNewStudentListener Im using student instead of customers, all was fine until now, when i write the command above
You certainly can: To start the queue worker in the background, in the terminal run (with no quotes) "php artisan queue:work &" Then, that returns a Process ID (an identifier for that particular job) Using that PID you can terminate it with "KILL [enter PID here]" As an example "KILL 123456" If you forget the PID, you can find it by running "jobs -l" Hope that helps!
php artisan queue:work does not work for me. I code exactly as you do, I create an event and some listeners & connect them vai EventServiceProvider. It`s works fine but when I add queue, queue works but mail does not sent. my work processes : 1. update .env file with =>QUEUE_CONNECTION=database 2. implements ShouldQueue in listener 3. create queue:table // it creates a jobs migration 4. php artisan migrate:fresh 5. php artisan queue:work If I create new customer, it creates a queue processing.. but after after sleep(5) work, it shows an error, failed All work fine but mail does not sent to mailtrap (without queue, mail sent successfully) Please let me know what i m missing?
@@frederikzutterman50 php artisan queue:work command does not work properly error is: [2019-09-22 22:55:01][7] Processing: App\Listeners\WelcomeNewStudentListener [2019-09-22 22:55:01][7] Failed: App\Listeners\WelcomeNewStudentListener
Thank you Maestro for making complex to simplex! Keep it up and stay safe!
Short, but clear. Looks like the best explanation of the Laravel Queues. Thank you !
People always ask me.. how did you learn laravel so fast?
My answer is, dedicating my life to Coder's Tape. lol
You sound like a GTA Character. Absolutely Love it! And great Tut!
that's a great video! thanks a lot!
btw what are some scenarios you would use Queues for?
eaxmple: user verification email upon new sign up?
WOW that's a very simple and great tutorial
Thank You!
Nice video on queues. I prefer aws sqs or redis queue but I suppose they all do the same thing
Thank Y for share your knowledge, I'm learning a lot with your videos!
Great to hear!
This is a pretty nice video when you see that there are lot of other not so good Indian tutorials out there (please no offence) that explain in this detail
Why do we add a delay time ? (any practical examples ?)
Super nice tutorial👍
Awsome video series but with this one I ran into an issue :
ShouldQueue does not work for me.
All the listeners do their tasks but when I add ShouldQueue all works identically the same as before.
So the timer waits for 10 seconds and the mail coms into mailtrap.
Nothing is added to my jobs table, but since there is a jobtable migrations have worked.
I have changed my driver to database in the ENV file and I am using sqlite just as in your tutorial.
I'm working on windows 10 with composer and installed nodejs package for the npm etc. as you have shown in previous videos of this series.
Restaring php artisan server did not change anything.
Running the same laravel with wamp running and php artisan server off had the identical result of skipping the Queue entirely.
Any other suggestions I can try to make it work as intended?
stop the server, then clear cache - php artisan config:cache then restart the server. anything that affects the .env file needs some cache clearing and restarting the server. that should work
Don't know if someone else got stuck with this but if it still takes a long time make sure to clear the cache using php artisan config cache
I do both, php artisan config:cache and config:clear, restart server and boom!
Thanks sir !
Something i'm not sure: In production is it Cron used to fire queue:work ?
No. You need to install Supervisor to run that as a background process.
I'm a bit confused on the jobs table. Are all jobs removed from the table once they have been executed?
That’s correct. Jobs table is just a queue. Once the job gets processed, the entry is erased. If the job fails, there’s a failed jobs table.
@@CodersTape Thanks so much for your prompt reply. This series is awesome.
Hi Coder's tape, great series ever. I have one error for jobs lecture
[2019-12-23 12:28:34][22] Processing: App\Listeners\WelcomeNewCustomerListener
[2019-12-23 12:28:34][22] Failed: App\Listeners\WelcomeNewCustomerListener
i tried 22 times but it showing only this error again and again. Please tell me how to fix this.
Hi coder tape in your tutorial series you can't teach how to connect our database to our table plus software.
Amazing, Thanks alot
thank you! it really helps a lot
I'm in love 😍 with laravel because of you hahaha, just a question please, do we need that sleep(10) function always?
No, don't use it. He just used it to simulate a slow mail server.
Thanks!
Then I only need to use the "implements ShouldQueue" in a class to queue the methods inside it?
laravel.com/docs/8.x/queues#delayed-dispatching
You're really awesome, i never seen before like you
I can't thank you enough for the great course. I have a question: Can we control the order of listener handlers e.g (chain them based on their return results)?
No but you can always fire new events in your listener to trigger other listeners. For example, you fire an event of GenerateBlahReportEvent, then you are calculating a big report and it takes 3 minutes to run the job. After you are done, you fire, ReportBlahHasCompletedEvent and it has its own set of listeners send an email for example.
@@CodersTape GIANT THANKS! That should work too.... Great!
How to do it on the production server please tell me i am new to it
Im facing the same issue here :/
any fix please ?
it using database a bad idea in production? Why would using redis be the better solution?
I got lost when you open the TablePlus app :( i'm zero knowledge here.
Just showing you how it’s structured. For visualization only, no need for TablePlus
just install tableplus and open the file database.sqlite (name_of_project/database/database.sqlite)
@Frederik
php artisan config:cache
worked for me.
L6.0
Why not just reply to his comment. Making a new comment does nothing for him unless he goes through the comments manually. Replying sends him a notification.
@@uros.u.novakovic
Thanks .
I'm not sure why but i need to use php artisan config:cache command and then restart the php artisan serve to make it work ^^a
please make a tutorial on the webhook server/client.
can you please explain the difference between events and jobs, both look same to me :)
The difference between an event and a job is that you can listen for an event and trigger certain tasks. So for example, Laravel actually fires many events internally and technically nothing happens. But you have the option to hook into those events and add your own logic. As a concrete example of that, Laravel fires events when saving, retrieving or updating records from the database. If you needed to perform something before inserting a record, you can listen for a saving event on the model and add that in. You can also fire your own custom events of course and optionally add listeners. This type of functionality is just not possible with jobs. Jobs are designed more for things like cron tasks. As an example of this, in one of my apps, I send a daily email at 9pm with a summary of that day's transactions. This is a job called DailyReportJob. There is no action (event) associated with this task, meaning that it's not tied into a specific event occurring in my app, so it's a job. Hope that clarifies it.
@@CodersTape great, thanks
The GOAT 🐐
I have a question everyone , does queue database work in production ? all my notitifications fails when i use queue:work :( on local everything is working like a charm.
were you able to find a solution?
completed all the steps as you said, but still its not using queue,
running the sleep() method and nothing found in jobs table
Try restarting your serve command after rechecking the .env file
@@CodersTape still it's not working,
code of my ShouldQueue.php
i think there's something wrong with it
@@CodersTape the issue is resolve it was just
php artisan config:cache
but i dont know why i need to clear cache every time to perform some task
@@Aqibroker01 I got same issue with you, thank u!
@@hieunguyenac4675 issue with me :D
quick question how do you link table plus to SQLite?
Nvm found out how. Guys you can download tableplus, open app and click sqlite, then a window pops up saying enter name and select db. select DB opens up finder and is looking for a file. Go into your project root/database and click database.sqlite this should connect and you should see the databases
@@giannizamora7247 Awesome! Thanks for sharing.
I have this issue when i put php artisan queue:work
[2019-09-22 22:55:01][7] Processing: App\Listeners\WelcomeNewStudentListener
[2019-09-22 22:55:01][7] Failed: App\Listeners\WelcomeNewStudentListener
Im using student instead of customers, all was fine until now, when i write the command above
Hello, enable subtitles please? Thank you!
please how do i solve this port 127.0.0.1:8000/ is just loading and did not open my laravel project on chrome again
Did your restarting the machine? Mac or PC?
Is not a Mac.. window and do you mean i should restart the system
is any way to run the queue job in the background without using the command " php artisan queue:work"
You certainly can:
To start the queue worker in the background, in the terminal run (with no quotes)
"php artisan queue:work &"
Then, that returns a Process ID (an identifier for that particular job)
Using that PID you can terminate it with
"KILL [enter PID here]"
As an example
"KILL 123456"
If you forget the PID, you can find it by running
"jobs -l"
Hope that helps!
Decided to put that on a video. Check out episode 30.
@@CodersTape waiting for e30, You are Genius, the series is going on really good I have ever seen, waiting for next. It's like premium.
The BEST as always!
you didn't tell us how to go from controller to job
php artisan queue:work does not work for me.
I code exactly as you do, I create an event and some listeners & connect them vai EventServiceProvider. It`s works fine but when I add queue, queue works but mail does not sent.
my work processes :
1. update .env file with =>QUEUE_CONNECTION=database
2. implements ShouldQueue in listener
3. create queue:table // it creates a jobs migration
4. php artisan migrate:fresh
5. php artisan queue:work
If I create new customer, it creates a queue processing.. but after after sleep(5) work, it shows an error, failed
All work fine but mail does not sent to mailtrap (without queue, mail sent successfully)
Please let me know what i m missing?
Could you please tell what the error is?
@@frederikzutterman50 php artisan queue:work command does not work properly
error is:
[2019-09-22 22:55:01][7] Processing: App\Listeners\WelcomeNewStudentListener
[2019-09-22 22:55:01][7] Failed: App\Listeners\WelcomeNewStudentListener
@@NazrulIslam-iz6sw just run php artisan config:cache and restart your server your code will work
hey, i'm Walking HERE
I keep Failing on inserting queue to jobs DB.. why is that??
anyway it's a cool Video.. thanks.
You may need to stop and restart your php artisan serve
@@CodersTape I had restart it, yet it still doesn't inserted. is 5.8 that different with 5.7?
Nothing was changed from 5.7 to 5.8 in that regard
@@CodersTape Thanks, I follow Ur tutorial again and found out the problem was from the passed parameter.
6:20 recap