Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel 4 Basics Getting Started with Laravel Installing Laravel

It would be nice to have an example about how to deal with several laravel installation in Homestead. Is that a plan?

When I replicate these steps for a second laravel project in the Homestead directory (in Sites), something appears to be wrong.. I am not sure what though :/

3 Answers

Ok the answer was probably easier than expected.

I just updated Vagrant (which takes time) and VirtualBox and it's now all working perfectly!

Thanks Ian anyway!

I'm just adding a comment here to explain what I found out.

So my entire problem was to work with one box (as meant to be) and several projects working with this box. Here is basically how I work with it.

This is my config inside my Homestead.yaml:

folders: - map: /Users/username/Homestead/Projects to: /home/vagrant/Sites

sites: - map: laraveltest.app to: /home/vagrant/Sites/laraveltest/public - map: laravelbb.app to: /home/vagrant/Sites/laravelbb/public - map: laravel.app to: /home/vagrant/Sites/laravel/public

From there Vagrant up your VM and then ssh into it. In order to run a project's migrations, you have to cd "Sites/your_project" first (inside the box!). Once you have done that you can run php artisan whatever..

Also note that, sometimes, the terminal just freezes after I run vagrant ssh. I noticed that it happens often through wifi and rarely with my cable connection. However a little research on google told me that it is a known issue of Homestead. I wonder if it's not therefore better to create an individual box per project. Any hint and tips about that topic?

I know this is not rocket science but I hope it will help another newbie like me! It's never easy to start doing all these things ;)

Kyle Haynam
Kyle Haynam
15,017 Points

So, I'm new to laravel and homestead and all that, and don't know what I'm doing. I managed to get an install of laravel up and running, messed with some stuff, broke some stuff, etc etc.

Now all I want to do is start over with another practice laravel site, which sounds like what you're doing with multiple sites. How?? I have my yaml file open and add in what seems to be the correct lines. And I've edited etc/hosts to include the ip address (although I don't know when the address should be 127.0.0.1 and when it should be 192.168.10.10...the test site I did get running never worked with "laravel.app"- only 127.0.0.1:8000)

So a simple question is when and how do the laravel files and folder structure actually get copied into my new site? When I do "vagrant reload --provision"? or do I have to manually add a folder for my site? Do i need to run these commands from a specific location? I thought all these were global commands now from adding it to my PATH.

pretty confused and frustrated, not sure if you can help me or not... thanks

Ok I see. That is not really what I meant. This is obviously the easy part of it but I wonder then what the config of homestead.yaml and /etc/hosts should be basically. This is because even if I add a map in the homestead.yaml, I am always redirected to the first project.

From there I think I don't get the /etc/hosts config .. Not sure what to do really.

I am supposed to run one box for all these projects right? so what would be a correct config to switch from a project to another?

Maybe even a correct workflow?

Sorry I am a bit lost here..

Ian Foppen
Ian Foppen
9,204 Points

In the video tutorial where Hampton created the project http://teamtreehouse.com/library/laravel-basics/getting-started-with-laravel/installing-laravel on 01:15 Hampton executes a command, change "laravel-basics" to the name you want it to have.