How to Setup Laravel using macOS OSX

Laravel is known as "The PHP Framework For Web Artisans". Visit Laravel's website for more information about this versatile PHP framework.

Laravel PHP Framework

Installing Laravel is not very difficult if you know the right commands.

Install Homebrew

Visit http://brew.sh

Copy and paste in the following command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install PHP with Homebrew

Find PHP 7

brew search php7

Install PHP 7

brew install homebrew/php/php70

Install mcrypt

brew install homebrew/php/php70-mcrypt

Find MySQL

brew search mysql

Install MySQL

brew install mysql

Install Composer

  1. Visit https://getcomposer.org
  2. Click Download
  3. Run the commands found in your terminal
  4. php composer-setup.php --install-dir=bin --filename=composer

Make Composer globally accessible

mv composer.phar /usr/local/bin/composer

Setup a new Laravel App

Download the laravel installer and make it available globally:

composer global require "laravel/installer"

Go to the directory you want to install your app and type:

laravel new blog

Run a Local Development Server

This will create a local development server at http://localhost:8000

php artisan serve

Create a new migration

This will create a new migration file in /databases/migrations/ for creating a tasks table.

php artisan make:migration create_tasks_table --create tasks

 

Visit sunny St. George, Utah, USA