My (Laravel) Development Setup

Björn Kaiser
4 min readSep 4, 2020

--

I first got in contact with Laravel in early 2012 I believe when I started a new job at Aboalarm as their Lead iOS Engineer. The first thing I tackled with my then boss Stefan was a complete rewrite of the backend — porting it over to Laravel. There is actually still a very old package on their GitHub that we worked on, Versions-For-Laravel. Comparing that to packages today is like day and night.

Homestead didn’t exist back then and many of the other tools one may became accustomed to over the years weren’t there. Since I liked Laravel so much it was my go-to framework when I started working on hotlaps.io about 1.5 years ago.

This is a brain-dump of my current setup that I use for my Laravel development but it also works for other PHP based projects — it is obviously just my opinion and your mileage may vary but I faired fairly well with this setup so far.

“File:Toolbox (7263382550).jpg” by florianric from Deutschland is licensed with CC BY 2.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/2.0

Version Control — git with bitbucket

I exclusively use git on bitbucket for this. The main selling-point for me was that they give you unlimited free private repositories on Bitbucket; something GitHub didn’t offer at that time, though I think they do now.

Code Editor — Visual Studio Code

I used several different editors over time and tend to switch every now and again. Starting with Notepad++ in my Windows days to Coda 2, Dreamweaver (don’t judge me, I was young!) and Aptana Studio. Right now I only use Visual Studio Code since it is a lightweight environment that has a good developer ecosystem with plenty of extensions that make your life easier every day.

VS Code Extensions

  • prettier (with the prettier-php plugin) for code formatting
  • Bracket Pair Colorizer — to not go insane when things get more nested
  • Jira And Bitbucket (Official) — to integrate issue tracking etc. directly into the editor
  • Laravel Blade Snippets — makes things a lot more efficient when writing Blade templates
  • Laravel goto view — allows you to jump to the view file of a blade component with a simple click, a massive time saver!
  • Laravel Snippets — just like the Blade Snippets extension jut for core Laravel stuff like route definitions etc. — super handy!
  • PHP Intellephense — proper code completion makes a big difference and Intellephense is an extension I don’t want to miss. It has a free version but I payed for a license since it was so good.

Dev Tools / Services / Composer Packages

  • Tinkerwell — this is an app that gives you a playground for Laravel apps and even for plain PHP. It’s a great way to quickly try out an idea or to write that odd one-off script. Worth the EUR 14,99 and runs on macOS, Windows + Linux.
  • Sequel Pro — granted, it probably isn’t the best tool for MySQL database admin stuff on the market but it does just what I need good enough and it is Open Source.
  • Laravel Homestead — getting a development server set up can be quite an annoying thing to manage. Installing extensions, different PHP versions, databases etc.. Laravel Homestead makes all of this a thing of the past by providing a ready-to-run and easily configurable virtual machine to work with.
  • larastan — Larastan is a Laravel specific wrapper around phpstan, a static code analyzer for PHP. The main goal is to find issues and errors in your code without having to actually run the code. It does a very good job in spotting wrong typehints in code and so on. A must if you want to add an additional layer of “safety” to your workflow.
  • Flow — did I already mention that I love statically typed code? I don’t write any JavaScript anymore without being able to add typehints to everything.
  • (homegrown) I wanted to bridge the gap between my Eloquent models and my frontend code which is typed with Flow. To make this easier on myself I wrote a Composer package for Laravel that generates type definitions (configurable) for my models which I can then use in my React components to get proper type coverage. I don’t have any immediate plans to Open Source this but I may actually clean up the code a bit, add proper documentation and then go for it.
  • (homegrown) Another package I wrote for hotlaps.io generates code for typed accessors for all my Eloquent models. I got tired of relying on the magic accessors for model properties and prefer getUserId() over $foo->user_id. It also has the added benefit of working well with Intellephense for code completion. It also supports Laravels API for custom accessors. The accessors are generated baed on the fields the model has in the database, maps their MySQL types to PHP types and formats the code afterwards with Prettier. Since it only generates a trait it can be added to your models within seconds. As with the other package, I don’t have any specific plans for releasing this as Open Source but might as well do it if there is any demand for it.
  • Laravel Forge — I am someone who enjoys writing code, setting up servers, installing patches, setting up deployment pipelines isn’t really something I enjoy that much. In the spirit of “do what you are good at, leave the rest to experts” I happily pay for this service to manage the server setup for my Laravel projects and automatic deployment from my Bitbucket repository.

Yeah, I think that is about the high level overview of what I use day-to-day to build and deploy my stuff. Since all those are subjective picks I’d love to hear from y’all what you use to make your Laravel workflows efficient.

--

--