"Extending" Laravel's Homestead
I put off moving my existing vagrant dev VMs over to [Laravel's Homestead](http://laravel.com/docs/homestead) for a couple of reasons:
- It doesn't completely match my production environments (Ubuntu 14.04 instead 12.04, PHP 5.5 instead of 5.4, Nginx instead of Apache).
- I knew I'd need to customize the VM anyway and I already had that worked out with my existing VMs (note the plural).
But I recently started migrating everything (Dev/Test/Prod) from Apache Nginx and PHP 5.5, so I thought I'd take a good look at Homestead. In hindsight, I don't know why I felt compelled to run multiple Vagrant VMs with basically the same architecture. I followed the Homestead documentation and set up 2 initial apps DU VideoManager and DU Videocast.
Videocast is dependent on VideoManager, so previously I had to make sure both VMs were running for Videocast to work, and now I'm planning on just adding any new dev apps to this VM as I don't see any downside. As simple as Homestead is, I still needed to add some additional dependencies required by VideoManager. I would be awesome if you could add additional dependencies to the Homestead.yaml file, or even just a pointer to my own shell script, but for now, I just created a script inside the root of one of my apps to run after the initial
vagrant up and after any subsequent
vagrant destroy && vagrant up. This provides a simple way to add some additional packages like php5-ldap, oh-my-zsh, and the PHP oracle driver. Simply log in to the VM and run the script as root when needed:
Another thing that would be a nice addition to Homestead.yaml, and something I'll try to add to my own shell script, is the creation of a database (in addition to the "homestead" db that is created by default) and the ability to import a *.sql file into that database. Here's the Gist of my current "extras" script in case anyone is interested: