This tutorial will show you how to use Queues in Laravel 5.5 For Email Verification's, this tutorial can be used for an introduction into queues and will help you in future requirements. Firstly if you need to set up Auth with the simple command
and follow my previous tutorial for creating the email verification. You can find that here.
php artisan make:auth
php artisan queue:table
php artisan queue:failed-table
php artisan migrate
Now make your way to the new folder created in App/Jobs you should see a new job called SendVerificationEmail. Open this file and move the the Mail Namespace and along with the ConfirmEmail we added to the RegisterController in the previous tutorial into the Job.
php artisan make:job SendVerificationEmail
//Add the user variable above the __contruct
//Add and assign the variable in the constructor.
public function __construct($user)
$this->user = $user;
//Now in the handle method we need to send the email, cut this out of the protected function registered in the Register Controller in the previous tutorial and change user to use the new variable.
Where you moved the email send function out of registered add this.
php artisan queue:work
nohup php /home/forge/default/artisan queue:listen > /dev/null 2>&1 &