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

Testing a Vue component part 4: more testing and faking time

Original – by Freek Van der Herten – 6 minute read

Welcome to part 4 of a series on how to test a Vue component. Here's the table of contents of the series: Starting out with tests The first test and snapshot testing Creating an instance of a component More tests and faking time (you're here) Jest awesomeness and a skeleton to get started More tests…

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.

Testing a Vue component part 3: Creating an instance

Original – by Freek Van der Herten – 4 minute read

Welcome to part 3 of a series on how to test a Vue component. Here's the table of contents of the series: Starting out with tests The first test and snapshot testing Creating an instance of a component (you're here) More tests and faking time Jest awesomeness and a skeleton to get started Creating…

Read more

Testing a Vue component part 2: the first test and snapshots

Original – by Freek Van der Herten – 4 minute read

Welcome to part 2 of a series on how to test a Vue component. Here's the table of contents of the series: Starting out with tests The first test and snapshot testing (you're here) Creating an instance of a component More tests and faking time Jest awesomeness and a skeleton to get started Setting up…

Read more

Testing a Vue component part 1: getting started

Original – by Freek Van der Herten – 4 minute read

Recently we released vue-tabs-component, a simple Vue component to render a tabular interface. If you want to know more about to the component itself I suggest you head to the introductory post on it. Like with the vast majority of our open source work this package comes with tests. In this series…

Read more

A Vue component to display tabs

Original – by Freek Van der Herten – 3 minute read

Last week my company released a vue-tabs-component, a quality Vue component to easily display tabs. You can view a demo of the component here. In this post I'd like to tell you all about it. Why we created it If you're just want to know what the component does, skip to the next section. Nearly all…

Read more

Quickly dd anything from the commandline

Original – by Freek Van der Herten – 2 minute read

Laravel's tinker command allows to run any code you want as if you are inside your Laravel app. But if you want to run a single line of code if can be a bit bothersome. You must start up tinker, type the code, press enter, and quit tinker. Our new spatie/laravel-artisan-dd package contains an…

Read more

A conversation on laravel-html

Original – by Freek Van der Herten – 4 minute read

Hi, how are you? I'm fine thanks! How are you? I saw you released another package last week. Yup yup, you mean laravel-html, right? It was actually coded up by my colleague Sebastian, who did an awesome job. But why put out yet another html generator? Html generation is a solved problem, right? Yes,…

Read more

Stay up to speed with PHP by reading these feeds

Original – by Freek Van der Herten – 1 minute read

In the PHP ecosystem we're blessed with so many people blogging about their favourite language. Everyday new interesting content on PHP gets posted somewhere on the web. Visiting each blog separately to see if new content has been posted is quite tedious. Luckily this problem has been solved long…

Read more

Make git work better with GitHub

Original – by Freek Van der Herten – 1 minute read

A few months ago I installed a command line utility called hub. I'm really fond of it. It's aim is to make it easier to interact with GitHub from the commandline. It's a wrapper around the standard git command. Once it's installed you can do stuff like this (take from the manual page) # clone your…

Read more

A Laravel package to quickly dump and load the database

Original – by Freek Van der Herten – 1 minute read

Last week our team released a new package called laravel-db-snapshots. It provides a few artisan commands to quickly dump and load a database. We've built this for is to help us develop features in an app that require the database to be in a specific state. With this package we can take a dump of…

Read more

An easy way to validate front end forms using back end logic

Original – by Freek Van der Herten – 2 minute read

Imagine you're building an single page application that has a couple of forms. How are you going to validate those forms? Because we don't want to refresh the page submitting the form as usual isn't possible. Adding validation logic to the JavaScript side of things would just duplicate the…

Read more

An easy to use server monitor written in PHP

Original – by Freek Van der Herten – 12 minute read

We all dream of servers that need no maintenance at all. But unfortunately in reality this is not the case. Disks can get full, processes can crash, the server can run out of memory... Last week our team released a server monitor package written in PHP that keeps an eye on the health of all your…

Read more

Our postcard collection

Original – by Freek Van der Herten – 1 minute read

All our packages are MIT-licensed. But if you use our stuff and want to make us happy, we highly appreciate a postcard from your hometown. This suggestion is mentioned in all readme's of our packages We've been asking for postcards for quite some time now and have built up a nice collection. Today,…

Read more

Laravel's tap helper function explained

Original – by Freek Van der Herten – 2 minute read

A little known helper function, called tap was added to Laravel 5.3. In this short post I'll explain how this function can be used. Let's first take a look at the tap function itself. It's actually a very short one. function tap($value, $callback) { $callback($value); return $value; } So you give it…

Read more

Packages that make developing Laravel apps easier

Original – by Freek Van der Herten – 3 minute read

In this post I'd like to share some of the packages that make developing a Laravel app easier. laravel-debugbar This package really needs no introduction as it is one of the most popular packages around. It's made by Barry Vd. Heuvel and it's a real powerhouse. Once the package is installed it…

Read more

A package to easily manipulate images in PHP

Original – by Freek Van der Herten – 4 minute read

Today we released a new package called image that makes manipulation images in PHP extremely easy. In this post I'd like to explain why we built it and how it can be used. Manipulating images in PHP To manipulate images in PHP there are already a lot of options. You can go hardcore and use the Gd or…

Read more

A checklist for all projects that are going live

Original – by Freek Van der Herten – 2 minute read

Apart from our open source work, we do client work at Spatie as well. Over the years we've learned that one of the most critical moments of a project is when it is going live. No matter how you confident you are about the correctness of the code base there are so many big and little things that…

Read more

Easily work with the Twitter Streaming API in PHP

Original – by Freek Van der Herten – 3 minute read

Twitter provides a streaming API with which you can do interesting things such as listen for tweets that contain specific strings or actions a user might take (e.g. liking a tweet, following someone,...). In this post you'll learn an easy way to work with that API. Phirehose When researching on how…

Read more