In this section you can read posts I've written myself.

Running PHP tests in parallel on GitHub actions

Original – by Freek Van der Herten – 6 minute read

A couple of years ago, Laravel introduced a great feature which allows to run PHPUnit / Pest tests in parallel. This results in a big boost in performance.

By default, it determines the concurrency level by taking a look at the number of CPU cores your machine has. So, if you're using a modern Mac that has 10 CPU cores, it will run 10 tests at the same time, greatly cutting down on the time your testsuite needs to run completely.

A default runner on GitHub doesn't have that many cores, so you can't leverage parallel testing as good as in your typical local environments.

In this blog post, I'd like to show you a way of running your tests on GitHub, by splitting them up in small chunks that can run concurrently.

We use this technique at Oh Dear to cut down the running time of our vast testsuite from 16 minutes to only just 4. In this blog post all examples will come from the Oh Dear code base.

Read more

Stay up to date with all things Laravel, PHP, and JavaScript.

You can follow me on these platforms:

On all these platforms, regularly share programming tips, and what I myself have learned in ongoing projects.

Every month I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.

A package to display solutions on the Laravel error page

Original – by Freek Van der Herten – 7 minute read

When Laravel switched to a simpler exception page, the ability to display solutions for an exception was lost.

Our latest package, called spatie/laravel-error-solutions brings back that powerful feature. When installed, it will display solutions for most common exceptions.

Here’s how that looks it:

And yes, some solutions, like the one in the screenshot above, can be executed on the exception page too.

In this blog post, I’d like to tell you all about it!

Read more

Creating beautiful invoices using Tailwind and Laravel PDF

Original – by Freek Van der Herten – 2 minute read

Last week, we released a new package called Laravel PDF that allows you to transform Blade views into PDFs. Under the hood, Chromium is used to perform the transformation. Because Chromium is an up-to-date browser, you can use any modern CSS you like.

Some people have asked if they can use Tailwind to style their documents. And I’m happy to report you can. Let’s take a look at a minimal example to showcase this.

Read more

Easily create PDFs in Laravel apps

Original – by Freek Van der Herten – 6 minute read

We’ve released a new package called spatie/laravel-pdf, a batteries-included package to generate PDFs in Laravel apps. Under the hood, it uses Chromium to generate PDFs from Blade views. You can use modern CSS features like grid, flexbox, and even frameworks like Tailwind to create beautiful PDFs.

In this post, I’d like to introduce and demonstrate the package.

Read more

New major versions for spatie/image and Laravel Media Library have been released

Original – by Freek Van der Herten – 11 minute read

We’ve released a new major version of spatie/image, v3. This package makes it very easy to manipulate images using PHP.

At the same time, we’ve also released a new major version of spatie/laravel-medialibrary. This is a powerhouse package that can associate all kinds of files with Eloquent models. The latest version of this package now uses spatie/image v3 under the hood for manipulating images.

In this blog post, I’ll explain why we made new major versions and how they can be used.

Read more

Creating my new album "Kind"

Original – by Freek Van der Herten – 17 minute read

This blog post will be a little different. I'm not going to write about programming as usual. Over the past few months, I have worked on my new album titled "Kind". You can listen to it on these platforms:

In this blog post, I'll share how this album was made from conception to release.

Read more

Video: the keynotes of Full Stack Europe 2022

Original – by Freek Van der Herten – 1 minute read

Last year at Full Stack Europe we had two great keynotes by two amazing speakers: Jeremy Keith and Kevlin Henney. We're very happy that we can share the recordings with you.

Next month, we'll have a new edition of Full Stack Europe, you can purchase your tickets here. We have an excellent line-up featuring Justin Jackson, Una Kravets, and people that work at companies like Meta, Google, Netlify. If you're familiar with the Laravel community, you'll also probably recognize Kai Sassnowski, Tobias Petry, and a few others! Hope to see you at the conference!

Read more

Craft emails that look good in each email client using MJML

Original – by Freek Van der Herten – 5 minute read

In a perfect world, email clients can render HTML as good as major browsers. Unfortunately, this is not the case. Email clients don't support modern HTML and CSS niceties and have a lot of quirks to be mindful of. Making sure an HTML email looks good in the most used email clients takes a lot of work.

To make crafting HTML emails a lot more enjoyable, the folks at Mailjet created a solution called MJML, which stands for "Mailjet Markup Language." It's an easy-to-use abstraction layer over HTML.

We have created a new package called spatie/mjml-php to easily convert MJML to HTML using PHP. If you're using Sidecar, you'll be happy to know that we've also created a package called spatie/mjml-sidecar, to convert MJML to HTML using Sidecar.

In this blog post, I'd like to introduce the package to you.

Read more