In this we will learn how to create a database connection in laravel. When you open the folder project of laravel, you will find a file named .env in it. You can connect to your database by typing your database name, user name and password in the same file. You can see it in the image below. You will see that the file of .env will be displayed in it.
As I am going to tell you in the following example, you can see that this connection is of laravel. You just have to type the database name, user name and password, you can see here too.
Keywords :- Database Connection in laravel 6.0, Database Connection in laravel 5.8, Database Connection in laravel 5.7, Database Connection in laravel 5.6, Database Connection in laravel 5.5, Database Connection in laravel 5.4, laravel 5.3, laravel 5.2
DB_DATABASE=db_name //database name here
DB_USERNAME=username //database username here
DB_PASSWORD=password //database password here