Programming

Homestead – Laravel – Setup

Laravel strives to make the entire PHP development experience delightful, including your local development environment. Vagrant provides a simple, elegant way to manage and provision Virtual Machines.

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!

Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 7.3, PHP 7.2, PHP 7.1, MySQL, PostgreSQL, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.

Link to documentation: https://laravel.com/docs/5.7/homestead

> vagrant box add laravel/homestead
> vagrant plugin install vagrant-hostsupdater

> mkdir c:/Sites/p1

> composer global require “laravel/homestead=~2.0″

To take advantage of the Homestead CLI, make sure to add the Composer /bin directory to your PATH

> homestead init

%APPDATA%\Composer\vendor\laravel\homestead\scripts\homestead.rb

Configure A Private Network IP


ADD THE NEXT LINE TO CONFIGURE HOSTSUPDATER PLUGIN

config.hostsupdater.aliases = settings["aliases"]

Go to etc/hosts and edit hosts file.

> vi etc/hosts

192.168.10.10 homestead
192.168.10.10 laravel.app

Edit homestead.yaml file

%HOMEPATH%\.homestead\Homestead.yaml

aliases: ["laravel.app"]

folders:
– map: c:/Sites/p1
to: /home/vagrant/Code

sites:
– map: laravel.app
to: /home/vagrant/Code/Laravel/public

Next execute the command.

> homestead up

Ali Imran
Over the past 20+ years, I have been working as a software engineer, architect, and programmer, creating, designing, and programming various applications. My main focus has always been to achieve business goals and transform business ideas into digital reality. I have successfully solved numerous business problems and increased productivity for small businesses as well as enterprise corporations through the solutions that I created. My strong technical background and ability to work effectively in team environments make me a valuable asset to any organization.
https://ITsAli.com

Leave a Reply