and follow my previous tutorial for creating the email verification. You can find that here.
php artisan make:auth
Creating Tables and Migrations for QueuesUsing Artisan commands this is made very simple.
php artisan queue:table
php artisan queue:failed-table
php artisan migrate
Update the.env fileYour .env file shouldn't change much from the previous tutorial. If you haven't looked I'm using Gmail and here is what the .env file should look like. Notice the addition of QUEUE_DRIVER.
Create the SendVerficationEmail Queue JobRun the following Laravel Artisan command to make a new queue job
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
Change the following.
//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.
Register ControllerAdd the name space to the top.
Where you moved the email send function out of registered add this.
Testing the Email Verification ProcessAt the command line, execute the following command to start listening for the queue.
php artisan queue:work
Completing the Email VerificationOn you Linux server run
nohup php /home/forge/default/artisan queue:listen > /dev/null 2>&1 &