Development Environment for Laravel 5.1

Access all tutorials in sprocket icon.

June 12, 2015 from author Bill Keck.

One thing often overlooked by beginning developers is setting up a proper development environment. Now exactly what constitutes a proper development environment is subject to wide interpretation, so I’m not looking to start arguments or flame wars.

I’m actually more of a follower than a leader when it comes to environments, and the team at work has been very helpful pointing me in the right direction.

So now I’m just trying to be helpful to those who want to learn Laravel 5.1 by showing them helpful tools for the job. I’m going to stick with the idea that simplest is best for now. I will write a separate blog at a later date for a more advanced environment, one that includes vagrant, live updates, PhpUnit tests firing off on whenever a file changes, and other advanced topics.

But for now, I just want to help people get started and address some of the more basic concerns. And although this may seem incredibly obvious to experienced programmers, the first question to be asked is should you use a linux, OSX, or windows environment?

I know nothing about straight linux machines, so can’t help you there. As for Windows, while it’s possible to develop on a pc/windows, to do so is to severely handicap yourself. Anyone who follows Laracasts for example, knows that Jeffrey way uses a macbook pro. So if for no other reason, I would recommend using a macbook pro just to have consistency when you are following along his lessons.

From personal experience, I recently switched to macbook pro, with OSX Yosemite 10.10.3 from Windows. It’s a pretty amazing improvement just from a speed standpoint. I feel like I can work twice as fast as before. But even more so, installing and maintaining programmers is easier and cleaner than it is with windows. So you gain a lot of time efficiency from not having to trip over environment and path variables like we so often do on windows.

I’m sort of an old school developer and the idea of using a laptop for development was counter-intuitive at first. I thought I would be constrained by the small screen. My vision problems are far-sighted, which sometimes leads me to short-sighted thinking.

Anyway, lucky for me the team at work showed me the way. We all use Henge Docks, one for work, and one for home. So I pop my laptop into the dock and it is instantly wired up to two large monitors, a wireless keyboard, and a wireless mouse.

When I’m done at work, I take it home, pop it into a mirrored dock setup there, and I have the same exact environment in both places. This doesn’t seem like such a big deal in theory, but in practice, it is. I get 100% consistency by working off a single machine. Since the battery keeps it running in transition, everything is always open for me, just how I left it. I don’t even have to open my IDE, it’s just waiting for me to do some work and have some fun coding.

I know cost is a factor, and not everyone can just decide to switch environments, but if you can, I would highly recommend it.

So now that we got that question out of the way, what do you need to put on your machine? I’ll give you a short list of what I’m currently using:

Each item above is linked, so you can get right to the downloads. So let’s talk a little about them.

MAMP is an all-in-one development environment, which gives you Apache, PHP, MySql, and PhpMyAdmin all in one download. It’s easy to install and manage. It’s easy for beginners to work with.

Iterm 2 is an enhanced Apple terminal for the command line.

Home Brew is a package installer for OSX. It makes installing things like Node a snap. You’ll note that I didn’t include Node on this list, I will be including it in the advanced environment tutorial that I will write at a later date.

I’m also leaving out version control for the moment, will get back to you on that one. I could have waited to get all this organized before publishing, but I’m putting this out now, so people know the environment I’m using for the laravel tips tutorials. This is the exact environment I’m using for these tutorials.

PhpStorm is my IDE of choice. It’s a paid IDE, where you could use something free like NetBeans, but I found PHPStorm to be exceptional, as I wrote about in this PhpStorm post. Sublime is another big contender for this role, but I don’t use it personally, so I don’t have experience to share with you on that.

If you do choose PhpStorm, then I highly recommend watching the free videos on Laracasts for PHPStorm. You can learn how to customize your own theme, which besides making it prettier, can help you understand the code better. And of course modifying the keymap, so you have your own custom shortcut keys is essential as is the live templates, which allow you store snippets of code template for re-use. I highly recommend this series of videos. I would write tutorials on this, but the videos really have it all and they are free, so you can’t beat that.

Sequel Pro is on the list, but for beginner tutorials, it is not really necessary. It is however in my current development environment.

Finally we have composer, and this is absolutely vital to modern PHP development. You will need it to install Laravel. I will write about Laravel installation as a separate tutorial.

Building the write development environment is a key ingredient of success as a programmer. It doesn’t happen overnight, so have patience. Become fluent in as many environment tools as you can, then choose the ones that suit you best.

Probably the most common beginner mistake is to rush into development without having a firm grasp of their development environment. Most mistakes I talk about, I have made personally. That’s ok. It gives me perspective and room to grow.

I hope you have enjoyed this tutorial and found it useful. Click on the sprocket icon at the top of the page to see all tutorials. Please comment, share, and like if you can, thanks!

I don’t have a donate button, but If you would like to support my work and learn more about Laravel, you can do so by buying one of my books, Laraboot: laravel 5* For Beginners, I really appreciate it.