User Registration – Database Connection

Before we proceed further make sure you know How Routing in Laravel works.

For the app we need to first create and connect to database.

First create a database for your app.

Once you create it then we need to assign the database connection setting in our app. We will assign the database configuration settings in database.php file located in app/config/database.php

db
database.php file

In this files you need to assign the host,username,password and database name.

Database config settings
Database config settings

I am using MySQL, so I have have made the settings in mysql.

That’s it! You are ready to use your database in your app.

Now lets create a user registration form in our next post.

Share this article: