Tag: php

Interfaces may only include hooked properties

With the release of PHP8.4 I tried experimenting with the features it provides. One such feature is support for properties in interfaces. Interfaces were getting a few improvements over time, but up to PHP8.3 only methods were allowed, omitting properties from the definition. Wan…

Post checkout composer install hook

Sometimes when working on a PHP project where there are a lot of branches potentially sitting on incompatible packages, it can be a pain to always remember to manually run composer i or whatever docker alternative or alias one might be using. After forgetting, there are error mes…

Better autocompletion for Laravel model factories

I use Laravel model factories quite extensively. Here's an older related post, in case you are interested. I tend to create a lot of methods inside them to simplify tests, utilizing Factory States. The current docs show the following example for using Factory States: <?php na…

PHP xDebug in Docker

This is a trashpost mostly used to store all the links I had in my tab. Also, I might need it again or it could help someone. There might me incomplete, missing or conflicting information below so take this with a grain of salt. Dockerfile Whatever you Dockerfile contents are, ad…

Exclude middleware for Laravel routes

In the world of web development, Laravel is a popular PHP framework that provides a wide range of features and tools to build web applications quickly and efficiently. One of its most useful features is middleware, which allows developers to filter HTTP requests entering their ap…