programming

How to setup laravel project using homestead

Step 1 :

Create a new directory Homestead by using this command 

cd ~/Homestead

Step 2:

Install the homestead directory by cloning the homestead repository into the host machine, clone through 

git clone https://github.com/laravel/homestead.git

Step 3:

Go to homestead directory by command 

cd ~/Homestead

Step 4:

Checkout from the git release branch using command 

git checkout release

Step 5:

Execute the bash init.sh command from homestead directory , create a homestead.yaml file. This is the file where you will configure all the setting for homestead installation

For creation of yaml file execute this command 

bash init.sh

Step 6:

The folders property in homestead.yaml file , lists all the folders you wish to share with homestead environment

in map variable , you will place your host machine path, in to variable you will place your guest machine path

folders:    - map: ~/code/project1      to: /home/vagrant/code/project1

In map variable , Code is the folder placed in home directory, suppose project1 is your laravel project , placed in that folder

In to variable , same as code is the same folder as same as in the host machine in which project1 is the laravel project

Step 7:

In sites property you will easily map a domain to your homestead.yaml project.

Map property contain the domain name, configured in host file, and in to property is the path of your laravel project index file.

sites:    - map: homestead.test      to: /home/vagrant/project1/public

In Map property, homestead.test is the domain name and in To property contain the path of index file

Step 8:

add a host to host file, Go to cd etc, then nano hosts and add this address

192.168.10.10  homestead.test

Step 9:

Now again go to homestead directory and run command

vagrant up

Step 10:

After this ,run command

vagrant ssh

Step 11:

Now project is running on that url

http://homestead.test

 

 

Cool Dev

Share
Published by
Cool Dev

Recent Posts

Setup Tailwind CSS with Angular 11

Install tailwind css with npm Run the following command to install tailwind css npm install…

1 year ago

NPM vs NPX

npx and npm are both command line tools that are used to install and run…

1 year ago

Configure laravel project in vagrant box in ubuntu

Step 1: Create a directory where you want to store project such as  mkdir ~/vagrant_projects…

1 year ago

Guide To Naming Conventions

Specifically, there are certain naming conventions available across all programming languages, also known as Snake…

1 year ago

How to use a CORS proxy to avoid “No Access-Control-Allow-Origin header” problems

If you want to solve the Access-Control-Allow-Orgin header problems, you can setup the cors proxy.…

1 year ago

React Native Hybrid with Ease

React Native Hybrid: Is React native hybrid? a popular question that mostly developers asked. Let…

2 years ago

This website uses cookies.