This post will quickly guide you in the process of creating a new Laravel Project using Vagrant, Scotchbox & the Laravel installer.

If you are using windows, you can run the same commands by installing Git Bash

Requirements:

  • Vagrant, VirtualBox & Git
  • Undertand basic git commands or know hot to copy/paste.
  • Linux or Gitbash.

Create a new Virtual Enviroment

Lets start with a new Laravel Project, In this case I will create a new project inside a VirtualBox enviroment using Vagrant and my favorite Box called Scotchbox.

git clone https://github.com/scotch-io/scotch-box

web@web ~-git-tutorial01_007.png

Navitage inside the newly created folder "scotchbox"

cd scotchbox

Start your Virtual Machine

vagrant up

web@web ~-git-tutorial01-scotch-box_008.png

You can now visit http://192.168.33.10/ and you should see your virtual box running.

Scotch Box ♥ A Vagrant LAMP Stack for Beginners That Just Works - Google Chrome_009.png

Create a new Laravel Project

First, lets open our virtual's machine SSH

vagrant ssh

Once you do this, you will be excuting commands inside a Virtual Machine, not your local machine

vagrant@scotchbox: ~_010.png

Navigate to public directory

cd /var/www/public

Make sure to update composer, (this will most likely prevent some errors)

composer global update

Create a new laravel Project

laravel new store

This will install Laravel automatically for you, download libraries, set enviroment file, etc vagrant@scotchbox: -var-www-public_011.png

Laravel is up and running!

Navigate to http://192.168.33.10/store/public/ and you should see the default Laravel Page. Laravel - Google Chrome_012.png

That was easy? What's next?

How about creating your first Laravel page with a repository in Github using an awesome IDE like PHPStorm?

tutorial01 - [~-git-tutorial01] - ...-scotch-box-public-store-resources-views-welcome.blade.php - PhpStorm 2016.2.1_013.png

Click here to open this tutorial.

Posted in Laravel, Composer Packages, Vagrant on Feb 01, 2016