Blog

In Memory of my Brother

System Versioning in MariaDB

Keeping track of changes to a resource is something a lot of applications have to deal with. It might be to help with debugging, allowing the user to jump between different revisions of a document, or keeping an audit log. In this post I want to show a way to implement this using system-versioned tables in MariaDB.

Testing HTTP Middleware in Laravel

Testing HTTP middleware in a Laravel app might look easy at first glance but can be surprisingly difficult to get right. There are many possible pitfalls. In this post, I want to show some of these pitfalls and what problems they can cause. Then, I will explain how I write tests for my custom middleware.

Contract Tests

There is more to the contract of an interface than just the methods it provides. All implementation of this interface actually need to behave consistently in the same situations. This post shows a way how we can test for this.

Properties of Tests

In this post I will explain the properties I want my test suite to have and how that affects how I write tests.

Reducing unnecessary details in tests

Tests are the only documentation of your code that is provably correct. As such, they need to be easy to understand. For this reason, we need to pay attention not to include unnecessary details in our tests.

Never Good Enough

In this post, I try to put my feelings into words about how I constantly struggle to live up to my own unrealistic expectations. This post is for myself but I decided to put it out there in case it helps anyone else.

Renderless Blade Components

We can utilize render function inside Blade components to achieve similar effects to renderless components in Vue. This post shows how it's done and what the possible uses can be.

Refactoring Legacy Code - Nullable Constructor Parameters

Working with legacy code can be difficult. In order to do any non-trivial refactorings, we first need to get the code into a test harness. This post explores nullable constructor parameters as one technique to make legacy code just a bit more testable.

Functional Programming Principles in PHP – Functors

Trying to apply the concepts I learned while studying Haskell to PHP with various degrees of success. In this post I explore what an implemenation of a Functor could look like in PHP.

Understanding filterM

This post is my attempt at trying to understand Haskell's `filterM` function.