All Development Posts
Craig Riley
3 weeks ago - Development
ESLint 9's new config file structure
Development moves pretty fast. If you stop to look around too much, you could lose it. One stalwart of many people’s stack doing some moving is ESLint. With version 9, ESLint is bidding adieu to its “rc” style configuration files and defaulting to a new “flat” config format. What is “flat” configuration? In previous versions...
Craig Riley
3 months ago - Development
Laravel forms: casting an input before validation
If you’re familiar with casts in Laravel, you’ll know them as a great way to transform values on their way to and from the database. A boolean cast – for example – is stored in the database as a 1 or a 0, whereas inside your code, it will be true or false. But what...
Craig Riley
4 months ago - Development
Adding a cache layer to Inertia SSR in Laravel
Inertia’s SSR server (which runs in a NodeJS process) is pretty quick, but sometimes you’re trying to shave every millisecond possible off your render time. A common question we’ve encountered is whether you can simply cache the server response and speed things up even more. Good news: you can. What makes this possible is a...
Craig Riley
6 months ago - Development
Inverse BelongsToThrough relationships in Laravel models
No, Laravel doesn’t actually have a BelongsToThrough relationship, a common frustration for models where you want to access the top level of a BelongsTo chain. Consider this setup: A user has authored many posts. Those posts have many reviews. So how do we define the inverse relationship back up from Review -> User (the post...