This is the easy way to install Laravel if you have installed XAMPP in your local machine. This is how you do it in Mac
1 Download the composer and install it in your computer
2 Now you can download the Laravel via composer using the following command in terminal
composer.phar global require "laravel/installer"
This will download the updated composer file for the Laravel
3 Now you have to create the project directory and download the Laravel files
php composer.phar create-project --prefer-dist laravel/laravel blog
4 After installing Laravel, you may need to configure some permissions. Directories within the storage
and the bootstrap/cache
directories should be writable by your web server or Laravel will not run.
You can run following command inside the terminal
sudo chmod -R 777 storage
Sometimes you will have to add the following code to App/Providers/AppServiceProvider
if you get error like this
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users
add unique users_email_unique
(email
))
at /Applications/
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}