This is more of an extension of my previous post "Setting Up Lumen + Mail". I wanted to take it a step furthur and show the basic setup for getting Redis to work, so you can queue not only mail, but jobs.
composer require illuminate/redis:5.5 to grab the Redis components.
app/Providers/AppServiceProvider.php and add the following to the
<?php // ... // Configs $this->app->configure('database'); // Enable queues $this->app->make('queue');
config/database.php and add the following:
<?php return [ 'redis' => [ 'client' => 'predis', 'default' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), 'database' => 0 ] ] ];
Don't forget to setup all your environment variables for Redis, as well, to enable Redis for job processing and cache, set the following environment variables:
That's it! You can now queue mail or process jobs.
Cover image credit: Jingyi Wang