First, you need to follow this blog tutorial for installing Nginx, PHP-FPM and MySQL to your computer (OSX Only).
Then, get the vhost.sh file to your PC and make it executable:
chmod +x /path/to/vhost.sh
You may also move the vhost.sh file to /usr/local/bin path for global use.
sudo mv /path/to/vhost.sh /usr/local/bin/vhost
And now you can use the vhost script to create new virtualhost.
sudo vhost domain.dev /path/to/document/root
sudo vhost foo.dev /Users/username/Code/Laravel/public