Skip to content

Jobs Queue

JP Barbosa edited this page Mar 11, 2016 · 4 revisions

Jobs Queue

Change mailer send to queue usage
nano app/Mailers/ArticleMailer.php
...
Mail::queue('emails.article', ['article' => $article], function ($message) use ($email) {
...
Install Redis server
brew install redis
Add Redis to Laravel
composer require predis/predis
Set Redis as queue driver
nano .env
...
QUEUE_DRIVER=redis
Create failed jobs table
php artisan queue:table
php artisan queue:failed-table
php artisan migrate
Run the server
php artisan serve
Run the Redis server
redis-server
Run queue listen
php artisan queue:listen
Before running verify if you have this article
open http://localhost:8000/articles/1/recommendations/create
Check your e-mail or if you configure to pretend send mail you can check the log
tail storage/logs/laravel.log
Add dump.rdb to .gitignore
echo 'dump.rdb' >> .gitignore
Add queue with Redis to Git
git add .
git commit -m "Use queue with Redis to send e-mails"
Next step: Captcha
Clone this wiki locally