install php artisan code example

Example 1: create laravel 6 project using composer

composer create-project --prefer-dist laravel/laravel blog "6.*"

Example 2: install laravel

composer create-project --prefer-dist laravel/laravel blog

Example 3: how to install new project in laravel

You can create project by 2 ways:

First is installing it without defining version:
composer create-project laravel/laravel yourProjectName

Secondly you can install by defining version:
composer create-project laravel/laravel="VersionOfYourChoice" yourProjectName

Example 4: insall laravel

composer global require laravel/installer 
laravel new blog

Example 5: start someones laravel project

1. composer update --no-scripts  or composer install
 2. php artisan key:generate 
 3. rename example.env to .env
 4. Change database credentials, set debug mode! Change app url
 4. php artisan migrate(make sure u have the database running in the server)
 5. php artisan config:clear
 6. you are good to go!

Example 6: install laravel

composer global require laravel/installer

Tags:

Misc Example