Installing Homestead and Laravel 5A guide to install Laravel 5.4 on Linux but can be applied to any operating system.
Virtual BoxInstall Virtual Box. In this tutoial I'm using VB 5.1.
VagrantInstall Vagrant. Once they have been installed we add the homestead box to Vagrant
Choose the option for virtual box and allow it to install fully before moving to the next step.
vagrant box add laravel/homestead
HomesteadNow clone the Repository from Git that contains homestead. Go to your Home Directory in Terminal. Copy and Run.
$git clone https://github.com/laravel/homestead.git Homestead
$cd Homestead //Mac/Linux $bash init.sh //Windows init.bat
LaravelIn your Home Directory make a directory called Code and go into it.
If you have composer installed then skip this code.
$mkdir Code cd Code
To install Laravel run:
sudo apt install composer
composer create-project --prefer-dist laravel/laravel YourBlog
If you want to run your project using your local PHP you can just run inside your directory
//Error laravel/framework v5.3.10 requires ext-mbstring sudo apt-get install libapache2-mod-php php sudo apt-get install php-mbstring //Install Dom Extension sudo apt-get install php-xml
Else in your Homestead/src/stubs/Homestead.yaml and (hidden)Home/.homestead/Homestead.yaml change the sites section to have.
$cd YourBlog $php artisan serve
In your terminal type
sites: - map: homestead.app to: /home/vagrant/Code/Laravel/public - map: local.blog to: /home/vagrant/Code/MyBlog/public
and add at the bottom(IP Address is from top of the YAML file so change accordignly
sudo nano /etc/hosts
Return to Home and into your Homestead Directory and run:
Go to local.blog in your browser and you should be able to see your new Laravel Site.
//If you havent created an SSH Key run and hit enter till its done $ssh-keygen //Then run $vagrant up