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 Homestead

More than one Laravel - Homestead project at a time?

can i set up more than one Laravel - Homestead project at a time? Would i just edit the homestead.yaml folder to something similar:

sites:
    - map: laravel.dev
      to: /home/vagrant/Sites/laravel-basics/public

    - map: project2.dev
      to: /home/vagrant/Sites/project2/public

Thanks

4 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Joseph;

A couple of things to remember for setting up multiple sites (or sites in general) in Laravel 4.x.

1) Edit your host file, like Andrew mentioned. This tells your computer where to go locally when you direct your browser to some-site.com and some-other-site.com.

2) In your Homestead.yaml file, remember to not use the tab key to align your text.

3) After you have edited your .yaml and host files, remember to run the vagrant provision command from the command line so that it will reload your Homestead.yaml file to tell Laravel where to go for each URL.

That would be my general list of things to remember to do. I have multiple Laravel Homestead projects on my system and it is certainly doable as long as the computer knows where to go to get the information for each unique site.

Happy coding,

Ken

Andrew Shook
Andrew Shook
31,709 Points

Yes, was far as I know that's the basics of it. You may need to remember to go in a edit you vhost file too.

It does work, except do not use tabs. Yaml files throw errors with tabs. Spaces only.

Thank Ken. The tab key was the hang up for me. Otherwise all is working fine.

Thanks for the help

Ken Alger
Ken Alger
Treehouse Teacher

Can't tell you home many times I zip through my Homestead.yaml file and use the tab key. Run vagrant provision and then have the light bulb moment. Sometimes it is the "silliest" things that cause the greatest issues.

Pleased it all worked out.

Happy coding,

Ken