Laravel Installation


Example

Detailed instructions on getting laravel set up or installed.

composer is required for installing laravel easily.

There are 3 methods of installing laravel in your system:

  1. Via Laravel Installer

    Download the Laravel installer using composer

    composer global require "laravel/installer"
    

    Before using composer we need to add ~/.composer/vendor/bin to PATH. After installation has finished we can use laravel new command to create a new project in Laravel.

    Example:

    laravel new {folder name}
    

    This command creates a new directory named as site and a fresh Laravel installation with all other dependencies are installed in the directory.

  2. Via Composer Create-Project

    You can use the command in the terminal to create a new Laravel app:

    composer create-project laravel/laravel {folder name}
    
  3. Via Download

    Download Laravel and unzip it.

    1. composer install
    2. Copy .env.example to .env via teminal or manually.
      cp .env.example .env
      
    3. Open .env file and set your database, email, pusher, etc. (if needed)
    4. php artisan migrate (if database is setup)
    5. php artisan key:generate
    6. php artisan serve
    7. Go to localhost:8000 to view the site

Laravel docs