As an experienced iOS developer, I interface all the time with backend services, and JSON RESTful APIs in particular. It’s a fairly common story for iOS developers to begrudge their work being blocked by backend holdups or bugs, and so, I thought I might as well try to try my hand at backend development to see if I could fix these problems myself.
Working on Apple platforms is simple. Language? Swift. OS? MacOS. IDE? Xcode. On and on, many questions have one answer. So you can imagine my uneasiness when asking the same questions on my first steps into backend development. Language? Uh, Ruby or PHP or Javascript or Java or … OS? Well, you can develop on whatever you want and you can run software on whatever you want, but probably something UNIX. IDE? Well, what OS did you pick? And what language? And why aren’t you using Vim you filthy casual? (Emacs get out.)
Okay. I had some choices to make. I’ve heard from a few sources that backend should be old, boring, and crucially, reliable. I could think of no better candidate than PHP, and given that a few of the projects I’ve worked on have successfully deployed with PHP and I have some previous experience with it, it seemed like a reasonable first choice.
But I don’t want to fall into the trap of writing bad code, which I understand is easy to do in PHP, and I also don’t want to write code that has been written better by people that came before me. So I did some digging for PHP frameworks, and I found Symphony, CodeIgniter, and Laravel. The way that I picked one of these was the very scientific approach of picking the one with the most starts on GitHub, for better or worse, which at time of writing is Laravel.
I now set out to get a development environment up and running for Laravel, and to do that, here’s what you do. You’ll need to download Vagrant, which is a manager for virtual machines, VirtualBox, which is a virtualization engine, and Homestead, which is a nicely configured Laravel virtual machine. Homestead uses Vagrant which runs on VirtualBox.
To get this up and running, I found these tutorials very useful:
- Laravel Homestead Tutorial – #2 Setup on YouTube
- Homestead installation instructions in the Laravel docs
- Laravel Tutorial: Step by Step Guide to Building Your First Laravel Application
- Say Hello to Laravel Homestead 2.0
- Homestead Laravel Hello World
- And this small tip about an error in provisioning
It took a while, but I now have it working, and I’m ready to start developing my Laravel app.