Laravel Project Deploy by Git

Asked

Viewed 5,291 times

1

I need to deploy an Laravel project installed on a dev pc on a Linux server.

After downloading everything via Git, some folders are ignored by .gitignore.

How do I run Composer to reinstall all dependencies? It also has npm?

1 answer

3


You can follow the tutorial for installing and configuring the Laravel here on official documentation.

Taking into account that you have php and composer in its global variable PATH, for a new Laravel installation, run:

composer create-project laravel/laravel nome-do-seu-projeto --prefer-dist


Cloning a project and installing the Laravel

I will again consider that you are running an operating system Linux and with the git installed, do the following:

Clone the project

git clone [email protected]:seuprojeto

Access the project

cd seuprojeto

Install the dependencies and framework

composer install --no-scripts

Copy the .env.example file

cp .env.example .env

Create a new key for the application

php artisan key:generate

Next you should configure the file . env and run the Migrations with:

php artisan migrate --seed

Regarding npm, this varies from project to project, but you will probably also need to run the following commands:

npm install

bower install

gulp

If you have no idea what these commands mean, I suggest you start studying one by one before putting an application into production. The official documentation of Laravel 5.2 contains two examples projects developed step-by-step, it is not a bad idea to start there, is in English but the text is easy to read.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.