Laravel Queues 101: Example with Sending Emails

  Рет қаралды 74,552

Laravel Daily

Laravel Daily

Күн бұрын

The first and free lesson from my upcoming course about Laravel Queues.
Full course "Queues in Laravel": laraveldaily.teachable.com/p/...
- - - - -
Support the channel by checking out our products:
- Enroll in my Laravel courses: laraveldaily.teachable.com?
- Try our Laravel QuickAdminPanel: bit.ly/quickadminpanel
- Purchase my Livewire Kit: livewirekit.com
- Subscribe to my weekly newsletter: bit.ly/laravel-newsletter

Пікірлер: 91
@JouvaMoufette
@JouvaMoufette 3 жыл бұрын
If you're using Laravel's workers, do not forget that any changes you make to code will not be loaded until you restart the worker. That includes all code for the project, including models or even files from composer in the vendor folder.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Yes I mention that later in the course.
@markrusso6276
@markrusso6276 3 жыл бұрын
This. I spent 3 days trying to figure why my code changes wasn't working when I pushed it live. It turns out all I had to do was restart the queue worker in Laravel Forge. Great tip!
@JoseFranciscoIT
@JoseFranciscoIT 3 жыл бұрын
In (development) you can use queue:listen to detect any code changes without restarting the worker
@hadesinferno813
@hadesinferno813 2 жыл бұрын
Supervisor would handle the restart of the workers
@JouvaMoufette
@JouvaMoufette 2 жыл бұрын
@@hadesinferno813 not in this case, unless there's some configuration item I'm unaware of that scans the directory for code changes. Last I checked, supervisor knows when it's no longer running and restarts it. Not when the code behind it changes and needs to be reloaded, since the executable that runs isn't the file that you've changed, but a core file of laravel
@m.caglartufan2454
@m.caglartufan2454 Жыл бұрын
Very well explained in such a short amount of time. Thanks for preparing this short video. I have been reading about queues in Laravel 9's documentation, everything made sense to me while reading to me but once I'm done reading almost most of that single long documentation page queues, I've got problems implementing it. So, I decided to come youtube and search for a quick tutorial and here is your video. Awesome!
@seyedabdorezalabbafi6225
@seyedabdorezalabbafi6225 Жыл бұрын
I just wanted to thank you... for your proficiency and fluency to transfer concepts quickly and clearly... you're amazing
@william254
@william254 2 жыл бұрын
Awesome video. Seriously, the knowledge you give is invaluable.
@selselvatocodefo
@selselvatocodefo 3 жыл бұрын
Learn tons from every single video. Thanks.
@renwar
@renwar 3 жыл бұрын
A course waiting for so far.
@sunnysk43
@sunnysk43 3 жыл бұрын
Very interesting topic. Looking forward for the full course - will definitely buy. Great as always!
@LaravelDaily
@LaravelDaily 3 жыл бұрын
It's already released actually, just yesterday: laraveldaily.teachable.com/p/queues-in-laravel
@sunnysk43
@sunnysk43 3 жыл бұрын
@@LaravelDaily Amazing - thought in July ;-) Just bought it! Have a great weekend.
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Full course "Queues in Laravel": laraveldaily.com/course/laravel-queues
@mansoorkochy
@mansoorkochy Жыл бұрын
Full course on Laravel? Waiting for Larave daily
@abelenocrodriguez
@abelenocrodriguez 3 жыл бұрын
Very good video I am just now doing this in a very complex billing system, thanks for sharing your knowledge about this.
@JouvaMoufette
@JouvaMoufette 3 жыл бұрын
Biggest tip I can give: Don't forget that if you change any code that will be utilized by the worker (even if it's not directly on the job code, but models it accesses), you must restart the workers for that new code to be used
@abelenocrodriguez
@abelenocrodriguez 3 жыл бұрын
​@@JouvaMoufette Thanks for the advice, how could it be restarted?
@JouvaMoufette
@JouvaMoufette 3 жыл бұрын
@@abelenocrodriguez Depends on the way its being launched. But generally it is running in the background as a service. You just restart the service, just like you would apache or nginx
@abelenocrodriguez
@abelenocrodriguez 3 жыл бұрын
​@@JouvaMoufette Ok, I am using laravel.com/docs/8.x/queues#configuring-supervisor for the admin queue works on the server.
@JouvaMoufette
@JouvaMoufette 3 жыл бұрын
@@abelenocrodriguez Yeah just check out the instructions on how to restart a service being managed by supervisor, but this is definitely a case where if you make changes, they won't be applied immediately to the workers since it's a long running process.
@ayenewyihune
@ayenewyihune Жыл бұрын
Great video, thanks
@phil86_
@phil86_ 2 жыл бұрын
Great lesson
@sthreetorch
@sthreetorch Жыл бұрын
Awesome! Thanks man
@cutiex7357
@cutiex7357 3 жыл бұрын
Damn you are so good, thank you!
@IvanilsonRibeiroConsultor
@IvanilsonRibeiroConsultor 2 жыл бұрын
Hello Sir .. I loved the material
@mykola.slisarenko
@mykola.slisarenko 2 жыл бұрын
That's a good case! Have you ever tried to implement mails queues using event listeners and SerializesModels? There might be some errors with losing models relationships
@nabeelyousafpasha
@nabeelyousafpasha 3 жыл бұрын
Thanks @povilas Its good to see growth in your audience. I remember when I was only one of few who liked and subscribed
@jaydevgodvaishnav9433
@jaydevgodvaishnav9433 2 жыл бұрын
Thank you for your tutorials. Can we use database driver for email and AWS SQL both together ?
@UsmanAli-yv6vo
@UsmanAli-yv6vo 3 жыл бұрын
Very helpful
@josiasvelazquez1095
@josiasvelazquez1095 2 жыл бұрын
You're the best.
@congdatt
@congdatt 2 жыл бұрын
thanks bro, respect
@marcellinobong
@marcellinobong 2 ай бұрын
GOAT OF LARAVEL
@amirishak1431
@amirishak1431 2 жыл бұрын
master of laravel
@astucestech6611
@astucestech6611 2 жыл бұрын
Thanks !
@MikeNugget
@MikeNugget 2 жыл бұрын
Nice video! Would be great to make mini-tutorial how to setup Laravel Queue Jobs with Redis)
@enzzoostia4798
@enzzoostia4798 3 жыл бұрын
This tutorial is so timely thankss! How would i go about enabling the queue on my production server without closing the terminal?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Running queues on production will be explained inside the course.
@rezaz8238
@rezaz8238 Жыл бұрын
Great Video... I have a question though, Is it ok to have nested queued jobs? Like you have in the video
@devsbuddy
@devsbuddy 2 жыл бұрын
Problem is in my project setup I am sending dynamic mails using only one mailable class so I don't have any notification to dispatch But luckily Laravel has should queue option in mailable class itself which saved my day. One more thing can you please explain how to handle failed jobs?
@erickzaratehernandez3953
@erickzaratehernandez3953 2 жыл бұрын
Hi Mr Daily, amazing video. What driver do you recommend using in production?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Redis
@justtestingmycurrentskills747
@justtestingmycurrentskills747 3 жыл бұрын
Thanks for the awesome Video as always. Sir, can you review some Api Response Builder Packages for SPAs like *MarcinOrlowski/laravel-api-response-builder* for example?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I haven't really used any of these packages, Laravel default API Resources have been always ok for me. Any of those builders have any *practical* advantages over default Laravel? In what cases?
@ChangeYourLifeForever
@ChangeYourLifeForever Жыл бұрын
I am on the THIRD LEVEL on your PATH Learning
@thorfinnthegoatmc
@thorfinnthegoatmc 2 жыл бұрын
Awesome video as always! May I know if you have already a video about rate limiting a Queue Job?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Not specifically about rate limiting, but you can see what topics are inside my course, there's a curriculum at the bottom: laraveldaily.teachable.com/p/queues-in-laravel
@thorfinnthegoatmc
@thorfinnthegoatmc 2 жыл бұрын
@@LaravelDaily thank you very much!
@senthur251
@senthur251 3 жыл бұрын
Excellent Video 👍 Is there anyway to notice/alert user’s queued job run successfully or not?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
Yes, I will talk about it in the course. Laravel Horizon is a good tool, also you can use something like Bugsnag to notify about any bugs, including the ones in queued jobs.
@hossam-eddineabouelqassim7440
@hossam-eddineabouelqassim7440 2 жыл бұрын
what is the best way to run it in production
@mdrakibul7903
@mdrakibul7903 Жыл бұрын
If I use scheduler to send email, should I use Queue ?
@sportsandstudy6985
@sportsandstudy6985 2 жыл бұрын
How can i run queue listen on live server please
@jadayash1479
@jadayash1479 3 жыл бұрын
Thanks alot, but why 3 jobs were created in the db, although you register once after implementing the ShouldQueue?
@cheoiiii
@cheoiiii 3 жыл бұрын
Because there's 3 users with is_admin = 1 in his users table already.
@carvalho1990
@carvalho1990 2 жыл бұрын
How do I use this queue command on production env? Imagine a have a Laravel api that sends email, everytime the end-point is fired. Do I need to keep queue:work running on production server? Thanks.
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Yes, you need to keep that running, with help of, for example, tool called Supervisor. Please read the official Laravel documentation on the queues, it's written there
@samiullah0011
@samiullah0011 3 жыл бұрын
which theme is in your video thumbnail?
@hadesinferno813
@hadesinferno813 2 жыл бұрын
would you advise using bcc or sending mails individually.
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Your personal preference
@dhanushj.a420
@dhanushj.a420 Жыл бұрын
How it will work on the server?
@abdulqayyumshah9217
@abdulqayyumshah9217 3 жыл бұрын
Works fine on localhoat but on production we need supervisor. Is there any way to run queues without supervisor?
@augustinewafula1346
@augustinewafula1346 3 жыл бұрын
you can use cronjobs to run the laravel scheduler
@abdulqayyumshah9217
@abdulqayyumshah9217 3 жыл бұрын
@@augustinewafula1346 thank you for guidelines. But both are different things
@abdulrehmandar8541
@abdulrehmandar8541 3 жыл бұрын
Hi povilas. Need you help. Can you please tell me what is the way to notify (alert , tost) on blade when a queue job is completed. Thank you.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I will discuss that inside the course, it will be a separate video.
@abdulrehmandar8541
@abdulrehmandar8541 3 жыл бұрын
@@LaravelDaily can you please give me a little reference or guide I need to implement real time notification functionality. It's an important task for me.
@arnoldlr30
@arnoldlr30 Жыл бұрын
Hi, i have an error when a try yo send emails to mailtrap, that happend when i send emails via schedule jobs, the images can not load, its because security content or something like that, any answer why this happend only with schedule jobs :(
@green-media-pl
@green-media-pl 2 жыл бұрын
Can I get a VAT invoice for the purchase of your courses?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
You should receive an email with the receipt from Teachable platform, immediately after your purchase. I don't control what's inside of that receipt, it all is covered by Teachable.
@hamzabashir2598
@hamzabashir2598 11 ай бұрын
how to install and configure the supervisor on the deployment server?
@LaravelDaily
@LaravelDaily 11 ай бұрын
We have a course lesson about: laraveldaily.com/lesson/laravel-queues-server/supervisor-configuration
@duyphamtech
@duyphamtech 3 жыл бұрын
Sorry, Could you please show me the database tool you are using?
@LaravelDaily
@LaravelDaily 3 жыл бұрын
It's table plus on my macbook
@duyphamtech
@duyphamtech 3 жыл бұрын
@@LaravelDaily thank you so much
@hamzaaltaf3633
@hamzaaltaf3633 3 жыл бұрын
very nice lecture sir can you tell me what is your text editor theme orange and something. thanx
@firdavs.ibodullayev
@firdavs.ibodullayev 2 жыл бұрын
I have a question, is it possible work queues without terminal? After registration automatically run queues
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Yes, with supervisor
@firdavs.ibodullayev
@firdavs.ibodullayev 2 жыл бұрын
@@LaravelDaily thank you
@hamzabashir2598
@hamzabashir2598 11 ай бұрын
sir how to do with the supervisor. please make tutorial on it@@LaravelDaily
@MrDevWithoutSong
@MrDevWithoutSong 2 жыл бұрын
The queues doesn’t work in real server just in localhost? Can you help me how the queues work in real?
@LaravelDaily
@LaravelDaily 2 жыл бұрын
Read the official docs on queues, about running queues, especially about supervisor: laravel.com/docs/8.x/queues#running-the-queue-worker
@MrDevWithoutSong
@MrDevWithoutSong 2 жыл бұрын
@@LaravelDaily I utilize the windows for programming the sites. The supervisor doesn’t work with windows. The supervisor works with which real servers? Thanks
@LaravelDaily
@LaravelDaily 2 жыл бұрын
I don't know any people who work with windows servers for Laravel. Real servers are usually Linux. You can use Windows locally, but again, you don't have supervisor there.
@raimonds.L
@raimonds.L 3 жыл бұрын
Imagine people start double-clicking because of the wait...
@LaravelDaily
@LaravelDaily 3 жыл бұрын
For that, you should disable the button after the click, with JavaScript
@Landrynadre
@Landrynadre 3 жыл бұрын
Hello, i have a problem with db query, can i send more info to your email? If yes i need contact email, please. I didn't see contat information anywhere.
@LaravelDaily
@LaravelDaily 3 жыл бұрын
I don't provide private consultations, except for cases where it could become a video which would be useful to others, too. And I have 2-3 weeks of queued videos at the moment.
Laravel Queues | Очереди на Laravel | Как реализовать долгие задачи
24:28
Lectoria. Обучение веб-разработке.
Рет қаралды 10 М.
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 5 МЛН
КОМПОТ В СОЛО
00:16
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 28 МЛН
Cat Corn?! 🙀 #cat #cute #catlover
00:54
Stocat
Рет қаралды 16 МЛН
Laravel: Optimize Queue Jobs To Be "Dumb" With Fewer Parameters
5:14
Why Don't We Have A Laravel For JavaScript?
12:36
Theo - t3․gg
Рет қаралды 91 М.
07 - The Queue Component in #laravel
12:44
Laravel
Рет қаралды 36 М.
Junior Code Review: Laravel Routes, Middleware, Validation and more
19:57
Laravel Queue Jobs: Avoid Failures by Double-Checking Everything
8:49
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel Daily
Рет қаралды 82 М.
SOLID Principles in Laravel: 5 Examples (+ New Course!)
21:07
Laravel Daily
Рет қаралды 72 М.
#76 Introduction Queue In Laravel
7:50
Mora Soft
Рет қаралды 3,7 М.
Some muslims mistakes #muslimfemale #hijab
0:11
Asel Mustafaeva
Рет қаралды 21 МЛН
Платье для богинь на свадьбу
1:00
Настя Бруно
Рет қаралды 3,6 МЛН
Reuse3♻️
0:25
Yoshipapa / よしパパ
Рет қаралды 7 МЛН
Reuse3♻️
0:25
Yoshipapa / よしパパ
Рет қаралды 7 МЛН
joga água e pula #funny #funnyvideo #shorts
0:17
Mundo de Alícia e Ana Clara
Рет қаралды 19 МЛН