Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to Handle Long processing asynchronous request through Queue using database in Laravel?

in this blog you are going to see that whenever you want to send email to multiple user then your view page takes a lot of time. so how can you decrease the load time and send email in background.

first of all you should create a folder Jobs under app and add two files eg. job.php and MailJob.php and now see both files code and add it to your files as well.

create a file to this location (app/Jobs/job.php) and put below codes in it.

Now create another file name MailJob.php and put below code:

and add below code to your SampleMail.php (app/Mail) location

now change some code in your store function of your Controller.php

now you should check you have a jobs table in your database. for this you should create a migration by putting below command
php artisan queue:table
For more reference see this article Click Here

Now you should run a command in terminal for processing queues:
php artisan queue:work
after this whenever you click on submit button in your form your form will submitted within 2 to 3 second and your email will process in the background and your request of email should be partially stored in jobs table.

for more details you can refer below articles:
Click Here: reference of queue

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.