How to clone and setup Laravel project from GitHub
Noble Okechi
Posted on September 7, 2022
Knowing how to clone and setup your Laravel project from GitHub is one of the most important thing you can know as a software developer. It gives you the ability to have access to millions of open source laravel projects out there.
In this content, I will be dropping a clear steps on how to clone laravel projects from github.
Step 1
Locate the Repository
If you already have a Laravel project you want to clone before now, it is advisable you copy the repository link as directed on the snapshot above.
Step 2
Move to Visual Studio Code Editor
On VS Code Editor, go to Source Control Tab
or use Ctrl+Shift+G
to locate the control source tab as shown on the image above.
Step 3
Clone Repository
Click on Clone Repository
, then enter the repository link copied and click on clone.
Step 4
Select Local Directory
After Step 3, the computer automatically promote you to select the local directory to clone the Laravel Project into.
For me, I'm cloning the project into my htdocs
because I'm using XAMPP Server.
At this point, your project is now cloning.
Step 5
Open Cloned File
After our project has successfully been cloned, we can now go ahead to open it.
Step 6
Setting Up Project
Laravel projects requires extra setups before it can run on your local computers.
First, we are going to install Node Module and Vendor files.
To install node module run npm install
on your VS Code Terminal and wait for it to complete.
To install your Vendor file run composer install
on your VS Code Terminal and wait for it to complete.
Step 7
Setup .env file
To setup your .env
, kindly duplicate your .env.example
file and rename the duplicated file to .env
.
Step 8
Setup Database
For this content, I'm using PHP MyAdmin Database
.
On your .env
file, locate this block of code below.
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=subnetweb
DB_USERNAME=root
DB_PASSWORD=
The block of code above represents your Database connection and subnetweb
is my database name, which you can create your database name to be something else.
Step 9
Commands
To finalize this everything, run the following commands on your terminal.
npm run dev
php artisan key:generate
php artisan migrate
php artisan server
Step 10
Conclusion
If you finished step 1 - 10 successfully, congratulation!!! you have just cloned your first Laravel Project from GitHub.
Click here to follow my youtube tutorial on this content.
Posted on September 7, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 29, 2024