Laravel Backend Configuration
Table of contents
prerequisites
Install laravel 9.x and above in your local system
Install composer
Install Xampp in your local system
Creating The Laravel Project
We will create a laravel project named "eLearning" you may change the name as you want it to be. We will create it using the folllowing command.
composer create-project laravel/laravel eLearning
Great work! Now let's dive into it's folders inorder to complete the chat up.
Move in to your project through command line using the cd command and the name you gave to your project.
cd eLearning
Now in the .env file makesure that you configure the database properly. In this project I am using phpMyAdmin mysql database, therefore my configuration would need not much change as it is the default configuration provided by laravel.
However, you need to mention the databse name. I named it as eLearnDB
in this project. It is highly recommended to use a custom database name and something that is not there in your databse previously as otherwise it will overnight the existing databse.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=eLearnDB
DB_USERNAME=root
DB_PASSWORD=
For the time being we would migrate our databse. In order to do so you need to run the following command. This would create the a databse in your Xampp server with the name you provided along with some tables that laravel maintains.
Note : Keep your Xampp server runing while running any of the commands.
php artisan migrate
This all for this session. In the comming session I would discus the data modeling for this project and the logic behind it. I hope in the next session you would learn how crucial database modeling is while building any application and how is it done.
I hope this article helped you. Thank You...
Subscribe to my newsletter
Read articles from Nayanmoni Baruah directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by