Building on this Laracast thread, I've been playing around with customizing logging in Laravel to take advantage of some of the Monolog processors. Cool stuff.
So I run an "extras" script after installing Laravel's Homestead that installs LDAP, Oracle Drivers, and Oh-My-Zsh among other things. But afterwards, I cannot run the "serve" command in the homestead VM to add new Nginx sites. I've finally figured out that the serve command is actually a bash shell alias function thingy inside .bash_aliases, so it's being ignored once I switch to Oh-My-Zsh.
Simply copying the serve function to .zshrc doesn't work due to some apparent syntax differences with bash and zsh. After digging around a bit, I've slightly modified the function to work now with zsh inside .zshrc:
Hopefully this helps someone else, or maybe someone has a better solution altogether.
Having a single Vagrant VM for all of my projects is nice, but I was used to controlling Vagrant from within a project's folder in Terminal and not having to go back to the central Homestead folder to run things like
vagrant up or
Adding these to my Oh-My-Zsh config (.zshrc) seems to do the trick:
alias devup="cd '/Users/gtaylor/Sites/Work/Homestead' && vagrant up && cd - 1> /dev/null" alias devreload="cd '/Users/gtaylor/Sites/Work/Homestead' && vagrant reload && cd - 1> /dev/null" alias devdown="cd '/Users/gtaylor/Sites/Work/Homestead' && vagrant halt && cd - 1> /dev/null"
I'm using these in conjunction with `alias dev='ssh [email protected] -p 2222'` from the Homestead documentation.
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).
I'm at Laracon 2014 in NYC, and as I predicted, it's a little overwhelming - in Lower Manhattan, seeing in-person all of these people I've been following and learning from the last year or so, and listening to really smart people talk about stuff which, in some cases, is a little over my head. But it's all good, in spite of a few kinks with the venue.
I think I fully grasped/comprehended about 50% of the talks, which is fine. That's probably a better percentage than some design patterns books I've read the first time thru. Taylor Otwell's keynote was an exception in that I fully understand the headaches with dev environments and deployment, so Homestead and Forge providing the "artisan"-like bookends to developing with Laravel makes perfect sense. I hope that Forge can (eventually) work with existing VPS environments to some degree, as I don't deploy new environments often, but would love to use it for some existing VMs that don't use the hosting providers currently supported.
Photo Credit: https://twitter.com/brianwebb01/status/467072660023676928
May 20, 2015
Laravel Custom Logging
May 19, 2015
Site re-built using Laravel 5.1-dev
January 9, 2015
Using the Laravel Homestead "serve" command with Oh-My-Zsh
November 6, 2014
Using Laravel's Artisan with Git for Deployment.
August 27, 2014
Pardon the Mess