Laravel can be defined as the exotic PHP experience, which is elegant to manage and provide virtual machines. The Laravel homestead is an official pre-package that provides a variety of development environment without the need of PHP or any other server software. Homestead runs on all kinds of the operating system which includes Mac, Windows or Linux system. The servers supported are Nginx, MySQL, Memcached, Node, PostgreSQL, Redis and several other options that are needed to develop Laravel application by making the user experience a delight.

Installation of Homestead on Mac

Before installing the software, you need to have a few software installed to make things easier for you. Those are VirtualBox, VMWare, Parallels or Hyper-V which provides easy to use visual installers for all operating systems.

What is Vagrant Box

Vagrant Box is the supporting software that comes along with Homestead. You can easily install this with all other supporting software. A simple command will do the installation for you: vagrant box add travel/homestead

What is Homestead

You could install Homestead by simply cloning a repository. Home directory will save the cloned repository. The Homestead box serves as a host for all your Laravel projects. Once you are done with the repository part you would need to run Bash init.sh command to configure the software. Configuring Homestead in 4 easy Steps

  1. Provider – This provider key in Homestead indicates that the Vagrant box should be either of VMWare workstation or Hyper-V or other supporting software previously installed.
  2. Shared Folders – Folders are the property of homestead file system to share with the environment. Depending on the changes on the files, the local machine will be synchronized.

There is no limit for the number of folders that you could create. ** 3. Nginx sites – Ngnix allows you the sites of the property that can be easily mapped on a domain to the folder of your Homestead environment. You can add as many sites as the environment is required. Homestead is a convenient virtual space for all your Laravel project. ** 4.** Hosts file** – In this step, you are required to add the domains for all the Nginx sites of yours, to the files that are a host on your machine.

The main purpose of doing this is, that the host file redirects the requests for homestead sites into your machine. On Mac/Linux, these files are located /ect/hosts by default.

DataBase

Pre-installed MySQL can be used to sync your Homestead environment. Once you are done with the Database synchronized, you are all set to host your new project in the Laravel Homestead. There are various additional packages that can be added based on its usage. Some of the most common ones which come with the Homestead package are:

  • Composer

  • Node

  • Memcached

  • Beanstalkd

  • Mailhog

  • Ngrok

For Mac and Linux users, this is something you need to do for daily global access.

By just adding the Bash function to the Vagrant Box, the scripts allow you to run on any Vagrant command in your system from anywhere and this actually will automatically point the particular command to your Homestead installation folder.

function homestead() {

( cd ~/Homestead && vagrant $* )

}

Ensure to change the -/Homestead to the location of your homestead local path.

Once it is installed, you can run Vagrant commands from anywhere in the system.

Conclusion

With the above-mentioned steps, you can easily install and access the marvelous Laravel Homestead and exploit all its options to your needs.

This article has attempted to provide you a better understanding of the better applications of this excellent PHP and use it extensively for your work. If you looking for more Laravel Tutorials you can visit my website from my Author Bio.

Like this article? Follow @https://twitter.com/OnlineInterview on Twitter