Laravel learning journey #1: Installing Laravel

Disclaimer: For this journey, I am using Windows.

According to the documentation, you have to download Composer first.

Then run composer global require "laravel/installer" from your command prompt to download laravel.

Also press the start button to search for PATH, choose Edit environment variable with your path. Go to the PATH and edit, add ;C:\Users\Shaun Ling\AppData\Roaming\Composer\vendor\bin, replace Shaun Ling with your computer name. This will let you use laravel command.

Then, go to the folder you want to install your laravel project in. Then type laravel new blog in your command prompt. This will create a laravel project named blog. This will install the latest version of laravel.

Some host does not have high enough version of PHP, so it cannot run the latest Laravel.
So, instead of laravel new blog, you can composer create-project laravel/laravel=5.2 your-project-name --prefer-dist, replace the 5.2 with the version of laravel you want and your-project-name to your project name.

Then, cd into your directory, and run php artisan serve. You can now access your development website at http://localhost:8000.

Leave a Reply