How to clone a Laravel project from GitHub

rojina dawadi
2 min readJul 23, 2021

1.Firstly open your terminal and run this command

git clone https://github.com/your-user-name/your-project-name.git

2.Run Composer Install

To run the Laravel project that is cloned from github, first need to install all the required dependencies mentioned in composer.json file. To do this navigate to the project directory in terminal and run following command.

composer install

3. Create .env file

Laravel projects need an environment configuration file to run the project. This file contains all the environment properties that are applicable to the environment you are working on. We can create this file by making a copy of .env.example file that should exist in the repo.

Add information like db_database, db_username and db_password in .env file. Also run php artisan key:generate to generate a key if its not in APP_KEY variable.

4. Migrations

After making connection with the database, we can run migrations by running the command php artisan migrate. Migrations are like version control for your database, allowing a team to easily modify and share the application’s database schema.

5.Databse:Seeding

If there are any seeders in the project we need to seed them by running command php artisan db:seed. Seeders in the Laravel framework allow us to populate our database with fake/seeded data.

6. Run the application in browser

Lastly, our application is ready to go on the floor. Run php artisan serve

and see the application in the desired browser typing localhost:8000

--

--