Originals — posts I've written myself.

A package to determine which track a last.fm user is playing original

by Freek Van der Herten – 1 minute read

If you've been reading the last couple of posts on this blog then you'll know we're busy building a dashboard. I think it's fair to say that everyone at Spatie is music addict. We have the unwritten rule that whoever who comes in first at the office is DJ for the day. One of the things we'd like to…

Read more

A package to manage events on a Google Calendar original

by Freek Van der Herten – 3 minute read

Like previously mentioned we're currently building a new dashboard to display on our wall mounted TV at the office. One of the things we want to show on that dashboard are important events for our company. Things like when a site goes live, when there's a conference we're going to visit, when we're…

Read more

Join 9,500+ smart developers

Every month I share what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.

No spam. Unsubscribe anytime. You can also follow me on X.

Getting package statistics from Packagist original

by Freek Van der Herten – 2 minute read

At my work I'm currently creating a new dashboard. That's a fancy term for an html page sprinkled with some Vue magic that will be displayed on tv screen at the wall of our office. I won't say much about the dashboard itself on this post, but I'll make sure to write something on that in the near…

Read more

How to setup and use the Google Calendar API original

by Freek Van der Herten – 4 minute read

For a project I'm working on I needed to interact with a Google Calendar. If you've ever worked with some API's by Google then you know their documentation can be very confusing. It's not that they don't have documentation, but code examples of common use cases are simply not present. You must wade…

Read more

Easily integrate MailChimp in Laravel 5 original

by Freek Van der Herten – 2 minute read

Today we released a new major version of our laravel-newsletter package. This package makes it easy to integrate MailChimp in your Laravel app. Under the hood V3 of the MailChimp API is used. If you're used the older version of our package be sure to upgrade by the end of this year: MailChimp will…

Read more

Laravel medialibrary hits v4 original

by Freek Van der Herten – 2 minute read

Today we tagged a new major version of laravel-medialibrary. In case you're not familiar with this package here's a quick rundown of what it can do. The package can associate all sorts of files with Eloquent models. It provides a simple, fluent API to work with. Here's a quick example: $newsItem =…

Read more

Making Eloquent models translatable original

by Freek Van der Herten – 2 minute read

Spatie, the company where I work, is located in Belgium. Although our country is quite small, there are three official languages: Dutch, French and German. That's why nearly all of our projects are multilingual. In most projects we used to rely on Dimitris Savvopoulos popular translatable package to…

Read more

Publishing package assets the right way original

by Freek Van der Herten – 2 minute read

At Spatie we do not only create a lot of Laravel packages, but we use also use a bunch of existing ones. In this post I'd like to give a quick hint to our fellow package developers. In the readme's of packages you'll often find an instruction like this to publish it's assets: php artisan…

Read more

A modern package to generate html menus original

by Freek Van der Herten – 4 minute read

Virtually every website displays some sort of menu. Generating html menus might seem simple, but it can become complex very quickly. Not only do you have to render some basic html, but you also have to manage which item is active. If a menu has a submenu you'll also want the parents of an active…

Read more

Let your clients use sftp on a Forge provisioned server original

by Freek Van der Herten – 3 minute read

A few years ago all the projects I worked on were served on a shared hosting environment. It was quite common that a client had ftp access to server to upload some files. A control like Cpanel or Plesk made it really easy to create some ftp accounts. Fast forward to today. Most projects are hosted…

Read more

A Laravel package to clean up models original

by Freek Van der Herten – 1 minute read

Most databases will contain some records that must be cleaned up. The reasons why a record can become unneeded are diverse: maybe it's a temporary record that was only needed for a little while if you're logging stuff to a table, a record may become too old to be of interest anymore ... To help a…

Read more

A modern backup solution for Laravel apps original

by Freek Van der Herten – 9 minute read

Today our team released a new major version of laravel-backup. It can backup the files and databases of your application to one or more external filesystems. It uses Laravel's native cloud filesystem to do this. The package can also notify you via Slack and/or email when something goes wrong with…

Read more

A package to easily generate feeds in Laravel original

by Freek Van der Herten – 2 minute read

Yesterday our newest package laravel-feed was released. It makes generating RSS feeds in Laravel very easy. It's very opinionated to fit the needs of our projects, but I believe lots of other developers will find it useful too. There's almost no coding involved to create some feeds. Installation…

Read more

Integrating Algolia in a Laravel application original

by Freek Van der Herten – 6 minute read

A few days ago Spatie, the company where I work, launched a new website: vrijwilligerswerk.be. Translated to english it roughly comes down to workforvolunteers.be. On the website various organizations can post their jobs that can be filled by a volunteer. Volunteers have a very user-friendly way to…

Read more

A package to dump your database original

by Freek Van der Herten – 1 minute read

A few weeks ago I released a package called db-dumper. The package can dump the structure and contents of a database to a file. Here's how it can be used: Spatie\DbDumper\Databases\MySql::create() ->setDbName($databaseName) ->setUserName($userName) ->setPassword($password)…

Read more

Using emoji in PHP original

by Freek Van der Herten – 1 minute read

Using plain PHP it's kinda hard to display emoji characters. In PHP 5 those characters could be generated by using json_encode. echo json_decode('"\uD83D\uDE00"'); //displays ? I bet no one can type this code by heart. In PHP 7 it's a little bit easier. The hot new version of PHP…

Read more

Why we are sponsering our local user group original

by Freek Van der Herten – 3 minute read

At the end of this month our local user group, PHP Antwerp, will hold it's third meetup. It'll be sponsered by Spatie, of which I'm a co-owner. In this post I'd like to explain why we are sponsering this event. Of course as a company it's good to get our name out there but there are other more…

Read more

Say goodbye to manually creating a robots.txt file original

by Freek Van der Herten – 1 minute read

If you don't want a site to be indexed by search engines you must place a robots.txt file. Typically you don't want anything indexed except production sites. Today Spatie released a new package called laravel-robots-middleware. It was coded up by my colleague Sebastian. Instead of you having to…

Read more