After installing the laravel, there is a .env file inside your project folder.
Open the .env file
Database Configuration
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=homestead <--- change database βhomesteadβ into your database name DB_USERNAME=homestead <--- change username βhomesteadβ into your MySQL username DB_PASSWORD=homestead <--- change password βhomesteadβ into your MySQL password
Mail Configuration
MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io <--- change the host name MAIL_PORT=2525 <--- change the port number according to host MAIL_USERNAME=null <--- change default username βnullβ into your mail username MAIL_PASSWORD=null <--- change default password βnullβ into your mail password MAIL_ENCRYPTION=null <--- change βnullβ into the tls (TLS)
Note:
For MAIL_HOST,
βsmtp.gmail.comβ for gmail host
βmail.domain.comβ for domain host (If you buy the server)
If you want to use the gmail server for mail configuration:
Login to your gmail account and under My account > Sign In And Security > Sign In to google, enable two step verification, then you can generate app password, and you can use that app password in .env file.
MAIL_DRIVER= smtp MAIL_HOST= smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME= test@gmail.com MAIL_PASSWORD= gmailpassword MAIL_ENCRYPTION=tls
After you make changes in your .env file, Run the command for removing the configuration cache => php artisan config:cache
I hope you understand and like this post. If you have any doubt regarding this post or other content regarding my site http://developerhelps.com/ .Please contact us.