View e-mail in browser newsletter #70

Hi, welcome to the 70th newsletter! 

My current setup (2018 edition)
After tweeting out a screenshot, it often get questions around which editor, font or color scheme I'm using. Instead of replying to those questions individually, I've decided to write a blogpost on my setup.

Searching models using a where like query in Laravel
For a project I'm working on I needed to build a lightweight, pragmatic search.

Easily switch PHP versions in Laravel Valet
Besides enjoying some greenfield work, we often have to work on legacy projects at Spatie too. Sometimes those projects don't run on the latest PHP version. Here's how we switch PHP versions.

Our packages have been downloaded 20 million times
We hit another cool milestone!

Get ready for your technical interview! Practice for free on Pramp - the world's largest platform for practicing DS&A interviews (sponsored link)
Can you ace a coding interview? Make sure you can. Pramp, a peer-2-peer mock interviews platform allows you to practice for free. Pramp's matching algorithm will make sure you'll get to practice with other awesome coders like yourself. subscribers are enjoying unlimited interview credits - just use the link

Avoid nesting using the crossJoin and eachSpread collection functions
While working on a package I found myself trying to combine some data. 

Laravel domains
My colleague Brent shares how we've been structuring our non-trivial projects at Spatie.

Resisting complexity
Last week Adam Wathan's excellent Laracon US talk was published. Highly recommened to watch it even if you don't use Laravel.

Advanced Eloquent: Avoid unified data models in complex apps
At the LaraconLive India conference, Shawn McCool shared some interesting ideas on how to handle models in complex apps.

Array merge vs. +
Here's Brent again! In this post he clearly explains the difference between array_merge and the + operator.

Building something new
Christopher Pitt has built his own new blog. Of course he uses lots of preprocessing goodness.

Replacing a built-in PHP function
Rob Allen performs a cool test.

Meanwhile on Twitter

On Twitter I see a bunch of people regularly tweeting very nice code snippets.

Some Laravel package testing tips

Analyze stack traces in PhpStorm

Use pluck to get a deeply nested value

Useful links from the archives

Introducing Browsershot v3: the best way to convert html to PDFs and images
To convert html to a pdf or an image using wkhtmltopdf and wkhtmltoimage tends to be the popular option. Unfortunately those tools contain an outdated binary. Browsershot uses the modern version of Chrome under the hood.

A Laravel package to log HTTP requests
Most of the sites we build for our clients contain some sort of contact form. For those client such forms are potentially critical to their business. We built a package to log such requests.

Seven Ineffective Coding Habits of Many Programmers
At last years Istanbul Tech Talks conference Kevelin Henney gave this great talk on how to improve the readability of your code. 

The official Vue.js style guide
The maintainers of Vue.js have recently published their official style guide.

Write tests. Not too many. Mostly integration.
In a fantastic post on his blog, Kent C. Dodds makes the case for focusing on writing integration tests, and stop going for 100% code coverage.

Dockerize your Laravel app with Vessel
Chris Fidao has created an easy to handle, well documented, Docker dev environment for Laravel projects.

How to remove a big file wrongly committed to a Git repo
Today I accidentally committed a multi GB file to the git repo of the project I was working on and pushed it. Let's see how to fix that!

Debugging the dreaded "Class log does not exist" error in Laravel
My colleague Sebastian took the time to write down the solution to a problem many artisans will come across at some point in time. 

Improving the performance of PhpStorm
PhpStorm is a fantastic editor. Unfortunately it can be quite slow. Brent blogged a few tips to make it run a bit faster.

Advertisement opportunities at

You are receiving this mail because you've subscribed at