In this section you can read posts I've written myself.
A package to dump anything to the log
In this post, I'd like to show you a quick demo of our new package called laravel-log-dumper.
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.
Replacing websockets with Livewire
Up until a few days ago, the real-time UI of Oh Dear (an uptime monitoring SaaS I run) was powered with web sockets. We recently replaced this with Livewire components.
In this blog post, I'd like to explain why and how we did that.
I'm going to assume that you already know what Livewire is. If not, head over to the Livewire docs. There's even a short video course on there. In short, Livewire enables you to create dynamic UIs using server-rendered partials.
Using the 1-click-installer to set up Mailcoach in no time
A couple of weeks ago, we released Mailcoach: an affordable, self-hosted solution to send out newsletters. Installing it into an existing Laravel application is quite easy if you have experience with Laravel.
We wanted to make getting started with Mailcoach easier for those without experience with Laravel or PHP. Using our a 1-click-installer on the Digital Ocean marketplace you can set up an entire Mailcoach installation in a couple of minutes.
In this blogpost I'd like to show you how you can use the installer and how we built it.
Some cool Laravel 7 Blade components
One of my favourite new features of Laravel 7 are Blade components. The allow you to define custom html tags that are backed by Blade partials. In this blogpost I'd like to show you a couple very handy components.
This blogpost assumes that you already know how you can use Blade components.
🐟 A package to execute a random artisan command
Aren't you tired of having to think about which artisan command to execute? The spatie/laravel-random-command package takes that pain away. It provides a random
command that will pick a random command and execute it.
Building complex forms with Laravel Livewire in Oh Dear
Together with my buddy Mattias Geniar, I run Oh Dear, an uptime checker service on steroids.
Unlike most uptime trackers, Oh Dear doesn't only check your homepage, but every single page of your site. When we detect a broken link or some mixed content, we send a notification. Oh, and we provide status pages, like this one from Laravel and Flare too.
In this blog post, I'd like to show you how we use Livewire to render some complex forms in the UI of Oh Dear.
📺 The Full Stack Europe 2019 keynote: Building by Jeremy Keith
Last year, my buddy Dries and I organised the first edition of the Full Stack Europe Conference. We recorded all the session and intend to publish each one of them in the coming months.
We just finished processing the first video. Here's the keynote, titled "Building" by Jeremy Keith.
How to configure and use multiple SES accounts in a Laravel app
How to check which version of PHP you are running
When working on open source code, I like using the latest version of PHP. When developers that are not on the latest version use the package, they might see syntax errors.
You might ask why Composer doesn't protect against this? When composer.json requires the latest version, how do devs, not on the latest version, can even install the package?
Well, there seemingly are a lot of people that only upgrade the PHP version on the command line. For handling web requests, they are unknowingly using an older version of PHP. Here's how to make sure you are on the latest version of PHP on both the CLI and for handling web requests.
Mailcoach v2 has been released with support for custom HTML editors and multiple mailers
A couple of months ago, my team released Mailcoach, a self-hosted solution to send out newsletters. It sends out mail via services like Amazon SES, Mailgun, Sendgrid, and Postmark. It can optionally track opens and clicks. When your email list grows, this is a much more cost-effective solution when compared to a service like Mailchimp.
Mailcoach can be used as a premium Laravel package or as a stand-alone app. When installed into a Laravel app, it can be greatly customized. The Mailcoach stand alone app can be used without knowing how to program.
Today we're releasing v2 of Mailcoach. It offers support for Laravel 7, html editors, and multiple mailers, together with a bunch of quality of life improvements. In this blog post, I'd like to walk you through these features and show some technical details.
On using arrow functions in PHP 7.4
In PHP 7.4 a widely requested feature landed: arrow function. In this blogpost I'd like to show you how I like to use them.
Writing readable PHP: decrease indentation by returning early
In this short post, I'd like to give you a tip on writing readable PHP.
How to use a MySQL database on GitHub Actions
Recently we started using GitHub Actions to test all our packages. You can read more about our general setup in this blog post.
For most of the packages, this works great. However, some of our packages, such as Laravel Tags, use JSON functions that are not available in SQLite. Luckily it's straightforward to use a database like MySQL in GitHub Actions.
Behind the scenes of Flare (or How to structure big Laravel applications)
How to write exceptionally good exceptions in PHP
In this video, which is part of the mailcoach video course, I show how I like to write my exceptions.
At the time of writing this post, we're running a contest where you can win a free mailcoach license.
How to refactor complex if statements
Have you every come across confusing if statements with complex conditionals such as this? I bet you did!
// please kill me 🤯
if (!(($this->shipping_country == "GB" || (strcmp($this-status, "Valid") !== 0)) {
To me, this is completely unreadable.
In the video below I show how I deal with this situation. Spoiler: add some tests around it and break the conditionals apart.
This video is part of the Mailcoach video course. It contains many more videos on how to write clear code. You can use this coupon code to get a nice discount of $10.
YES-I-WANT-TO-WRITE-READABLE-CODE
Laravel Tail can now tail remote logs
laravel-tail is one of my favourite packages. When installed in a Laravel app it can be used to tail the log file. To tail a log file locally, you just have to issue this command: php artisan tail and it'll start tailing the latest log file (so it works for both daily and single log files). Any line…
Using BetterTouchTool as a window manager
In this short post, I'd like to share how I use BetterTouchTool in my daily work.
laravel-event-sourcing v3 has been released
Our spatie/laravel-event-sourcing package is probably the best starting point for event sourcing in Laravel. It has excellent docs, that explain event sourcing from scratch, support for aggregates, projectors, and much more! It's all beautifully integrated in Laravel.
Recently we released v3 of the package. In this blogpost I'd like to walk you through the changes.