Skip to content

Blog

Page 3 of 77 - keep going...

When a validation failure causes a redirect loop

Laravel’s default behavior on a failed FormRequest validation is to throw a ValidationException, which the framework’s exception handler converts into a redirect to the previous URL with the input flashed to the session and errors attached.

That works perfectly when a person submits the form as the redirect lands them back on that page with the errors. It breaks down when the form submits itself, for example a bookmark to a GET form with validation, or submitting something into a target="_blank" (like PDF generation).

Aug 27, 2026 2 min read #laravel

The CTO Is a Communicator First

When you think of a CTO, what do you see?

Someone gray-haired, steering the ship like the last 20 years? A young, hot-shot that solves every single technical problem and then plays video games to relax?

It really doesn’t matter. I don’t actually picture or “see” anyone.

I can tell if a real CTO is in the room by just opening up my ears.

Aug 26, 2026 7 min read #business #management

Pluralization works in JSON language files

Laravel gives you two ways to define translations, PHP array files with short keys, or JSON files where the key is the default string itself. Array files are nice when you want stable, namespaced keys you reference everywhere. JSON files are nice when you don’t want to invent a key for every string and you’d rather just write the English (or default) version inline.

I picked JSON on a recent project, and then I hit a moment that gave me pause. I needed pluralization.

Aug 25, 2026 1 min read #laravel

Factory states can accept arguments

Most Eloquent factory states I’ve created are pretty simple like ->published() or ->cancelled(). They flip a flag or override a field to a fixed value making the call site of the factory easier to understand and requiring less ceremony. Awesome.

But, a state can also accept arguments, and that opens up some useful patterns like deriving values from another model passed in by the caller.

Aug 20, 2026 1 min read #laravel #testing

Strava iOS Shortcut to Start Last Activity

It’s already hard enough for me to start my exercise in the morning. Any friction in the way can make me stop it - or at least not track it.

Since I started using Strava to track my walks, I checked its iOS widgets. I figured I should be able to just click a widget to start an activity.

Sadly that’s not the case. They’re only progress widgets. So, after doing some research, I created my own iOS shortcut. Here’s how.

Aug 12, 2026 2 min read #ios

How to keep your tests off the real filesystem

Tests that read or write files can be really annoying. I’ll admit it, in the past I’ve skipped a few. I just hate having to think about seeding the files, cleaning them up after, and don’t get me started on the pollution left over when a test crashes before it can tear down.

Jul 23, 2026 2 min read #laravel #testing