πŸš€ DevOps & SRE Certification Program πŸ“… Starting: 1st of Every Month 🀝 +91 8409492687 πŸ” Contact@DevOpsSchool.com

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 Verify an Email in Laravel?

How to Verify an Email in Laravel?

Step 1. Create a new Project in Laravel, so Open git Bash. Write down the following command:-

$ composer create-project --prefer-dist laravel/laravel Emailverify "5.8.*"

Step 2. Now, Move to project directory on git Bash, so write down the following command:-

$ cd emailverify

Step 3. So, we have to Create a new Database. Go to XAMPP server->phpMyAdmin->Click New Database-> emailverify.

Mysql Database connection Laravel

Step 4.  Now, Go to .env file to set the project path and give the project APP_URL, DB_DATABASE name and DB_USERNAME name.

Step 5. Create the user authentication scaffolding. Write down the following command:-

$ php artisan make:auth

Step 6. Go to app\Providers\AppServicesProvider.php and write down the following code:-

 public function register()
    {
        Schema::defaultStringLength(200);
    }
use Illuminate\Support\Facades\Schema;

Step 7. Thereafter, Migrate tables into the MySQL databaseWrite the following command within git Base.

$ php artisan migrate

Step 8. Implement the MustVerifyEmail feature in User Model.

Step 9. Go to routes/web.php file and write down the following code:-

Auth::routes(['verify' => true]);
view raw web.php hosted with ❀ by GitHub
Route::get('/home', 'HomeController@index')->name('home')->middleware('verified');

Step 11. Open this link https://mailtrap.io/ and login with your Google account.

Step 12. Click the demo inbox link.

Step 12. Copy port, username , password and paste in .env file.

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=587
MAIL_USERNAME=964828f130769f
MAIL_PASSWORD=e1b767afc2a778
MAIL_ENCRYPTION=null
view raw .env hosted with ❀ by GitHub

Step 13. Firstly, You have to register, then log in your project.

Step 14. Now, you can see that it’s asking for email verification.

Step 15. After clicking, a fresh verification link would have sent to your email address. You can see the mailtrap.in the demo inbox.

Step 16. Click the Verify Email Address button . After that you’ll be logged in your dashboard.

Thanks

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.