Steps to download Laravel project locally from live server

Laravel is dubbed as the framework for web artisans. This is because its MVC architecture makes it easy for web developers to create web-based apps in short amount of time. And just like other frameworks, you can run it locally on your computer. But you do need to download the Laravel project and configure on your computer before you can start working on it. In this article, we’ll explain how to go about doing that.
laravel.png


Requirements of Running Laravel on your computer

Before you even think about creating a new or modifying a pre-existing Laravel project on your computer, you need to set a local environment for it.

You need three basic things. Those are:
  • PHP version 7 or more
  • Laravel Homstead
  • Composer Dependency manager
  • Terminal, which your OS probably has
Downloading the Laravel project

Now that you have all the prerequisites, it’s time to download the project on to your local machine, Most projects are hosted on GitHub or other similar Git repositories. You need to clone it. You can do that by copying the link and running the following command on the terminal:

git clone https://github.com/someuser/projectname

Alternatively you can download the ZIP package if available and set it up by unzipping it. From your terminal, navigate to the project folder and launch the project by executing php artisan serve.

Managing dependencies

The developer who created and uploaded the Laravel project might be working on a different development environment than yours. Therefore, you need to do some configuration works, even if the downloaded project works just fine. You’ll run into errors later on which would be hard to debug.

But generally speaking, you need to treat the downloaded copy as a fresh Laravel installation project. So it’s better to start from scratch.

First of all, you need to update the local .env file using your database connection. Check the propertise required by your local environment and update the same in the file and other files in the config directory. Then, navigate into your project folder from the command prompt and run the following commands:

Code:
npm install (if you already have npm installed, skip this)
composer install (if you already have composer installed, skip this)
php artisan migrate
npm run dev
This will install all the required dependencies required by the local development environment to run the Laravel project successfully.

Finally run the command php artisan server and browse the project from your local host. Open your web browser for this. If the project is working, then you’ve successfully downloaded and executed a Laravel project from a live server to your local machine.
Author
bhawanisingh
Views
5,347
First release
Last update
Rating
0.00 star(s) 0 ratings
Top