Setting up Laravel 5.2 with Homestead on a Mac

On your Mac

Download Vagrant box

vagrant box add laravel/homestead

Install Homestead

cd ~
git clone https://github.com/laravel/homestead.git Homestead

Initialise Homestead

cd Homestead
bash init.sh

You will now have a ~/.homestead/Homestead.yaml file where you can edit your sites and configurations

Setup route to Vagrant box

sudo vi /etc/hosts

add the following line:

    192.168.10.10  homestead.app

Startup your Vagrant box

vagrant up

On your Vagrant box

SSH into box

ssh -lvagrant 127.0.0.1 -p2200

 Install Laravel installer

cd /root
composer global require "laravel/installer"

add to /root/.bashrc

export PATH="/root/.composer/vendor/bin:$PATH"

reload bashrc source /root/.bashrc

Install laravel

cd /home/vagrant/Code
laravel new blog
cd blog
php artisan make:auth
php artisan migrate:install
php artisan migrate:refresh

Tips and tricks

Configuring new sites

Edit ~/.homestead/Homestead.yaml

Run vagrant provision from ~/Homestead dictory

Destory the Vagrant box

cd ~/Homestead
vagrant destory

Creating new sites

Simply add to sites in Homestead.yaml and run vagrant reload

sites:
- map: first.dev
  to: /home/vagrant/first/public
- map: second.dev
  to: /home/vagrant/second/public

Links

Official Docs