How to connect to mysql with laravel?
How to connect to mysql with laravel?
After successful installation of Laravel application
We need to create database connection.
In Laravel root folder you will find a file .env
Its looks like below code
APP_ENV=local
APP_DEBUG=true
APP_KEY=YOUR_API_KEY
DB_HOST=YOUR_HOST
DB_DATABASE=YOUR_DATABASE
DB_USERNAME=YOUR_USERNAME
DB_PASSWORD=YOUR_PASSWORD
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
In the .env file you will find a database connection details here you can give the required information about your database
Or you can also find the database details in config/database.php file bases on your type of database you can give the required database information
Comments
Post a Comment