Deploy Laravel project by Git

1

I need to deploy a 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 turn Composer to reinstall all dependencies? Do you have npm too?

    
asked by anonymous 21.06.2016 / 00:03

1 answer

3

You can follow the tutorial for installing and configuring laravel here at official documentation .

Considering that you have php and composer in your global variable PATH , for a new installation of Laravel, run:

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

Cloning a project and installing Laravel

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

Clone the project

git clone [email protected]:seuprojeto

Access the project

cd seuprojeto

Install 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

Then you should configure the .env file 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 example projects developed step-by-step, it's not a bad idea to start there, it's in English but the text is easy to read.

    
21.06.2016 / 02:35