Laravel Quickstart

This is a quickstart quide to setup a laravel project with local composer installation. Beware that the widely accepted practice is to install composer at system level. This quide installs composer at local level

This quide also assumes you have installed and configured PHP.

Create a directory

mkdir my-app

Install composer locally

For the official instructions read here

The local installation is quite easy:

cd my-app
php -r "copy('', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Create an empty Laravel project

composer create-project laravel/laravel my-app

Composer cannot create a new project in a non empty directory.

If you want, you can move composer to laravel directory.