Using the Laravel Homestead "serve" command with Oh-My-Zsh

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.

Using Laravel's Artisan with Git for Deployment.

There are many ways to handle web application deployment. Decisions on what method to use depends a lot on what type of hosting environment you are using, as well as the size, scope, and critical nature of the application. 

I handle the deployment of several applications with my own artisan "push" command that utilizes Laravel's SSH remote facade. The command is below, but first there's a little setup necessary:

Pardon the Mess

I just pushed up a ton of changes to the "Brewski" platform (maybe "platform" is a bit much), so I'm dealing with a few errors, but the big thing is that I decided to ditch the markdown editor I was using and switched to ckeditor. There's just so much more I can do with it and it's easier for a non-tech person to use. The downside is most of the posts are currently a little f-ed up while I fix some formatting problems.

Running Gulp.js in the background (OS X)

I discovered (or really just stopped ignoring references to) Gulp.js today and decided to give it a go. Now, this is not a post about what Gulp.js is - I'm assuming if you are reading this, you already know. This is about how to make me actually use it. The problem I ran into with Gulp right away was when you run it in a project in the terminal (`gulp`) with a gulpscript.js that watches certain folders (css,js, etc.), it has to just keep running in a terminal window in order to keep "watching" these folders. Even if you run the command with NOHUP to allow it to run in the background and free up the terminal session, you still have to remember to start it up for each project you're working on.

Controlling Laravel Homestead VM From Any Folder in Terminal

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 vagrant reload.

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.