Sign in

Joel Clermont

@jclermont.com
3.6K followers 168 following 1.1K posts

📖 Author of Mastering Laravel Validation Rules ✍️ I post useful Laravel tips masteringlaravel.com 🎙️ Co-host of show.nocompromises.io podcast 🐘 Organizer of Milwaukee PHP

PostsRepliesMedia
Joel Clermont @jclermont.com · 17h
Blade's loop variable makes it easy to treat the first or last item differently. But is it always the right tool for the job? Let's look at a couple of examples. masteringlaravel.io/daily/2026-1...
masteringlaravel.io
When to use Blade's loop variable, and when not to | Mastering Laravel
Sometimes there's a better tool
010
Joel Clermont @jclermont.com · 30/09/2026
Starting an Xdebug session for a web request is easy. But what about a queued job picked up by a worker? Let's see how to step through it line by line. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
How to step debug a queued job | Mastering Laravel
For those times when dd is not enough
010
Joel Clermont @jclermont.com · 29/09/2026
You've decided to pin your GitHub Actions to commit hashes. How do you convert a whole repo, and how do you keep it that way? Let's look at some tools that help. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Making pinned GitHub Actions an enforceable rule | Mastering Laravel
So nobody quietly adds a floating tag later
021
Joel Clermont @jclermont.com · 28/09/2026
Have you ever had someone review your pull request, make changes without telling you, and just merge it in? In this week's podcast, Aaron and I discuss whether the traditional code review workflow still makes sense when AI tooling lets us move faster than ever. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Is the traditional code review workflow holding you back? | Mastering Laravel
When a reviewer merges your PR without asking
000
Joel Clermont @jclermont.com · 25/09/2026
Moving to a new database server is a great time to clean up warnings hiding in your schema. Let's see how to find them and fix them before the import. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Cleaning up deprecated warnings during a database migration | Mastering Laravel
Don't ignore it
010
Joel Clermont @jclermont.com · 24/09/2026
Pinning your GitHub Actions to a commit hash is more secure, but who wants to update all those hashes by hand? Let's look at how to automate it. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Keeping pinned GitHub Actions up to date | Mastering Laravel
Let a bot do the boring part
020
Joel Clermont @jclermont.com · 23/09/2026
Importing a big database dump can leave you staring at a silent terminal, wondering if anything is happening. Let's look at a small tool that fixes that. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Monitoring progress of a big database import | Mastering Laravel
Without this, it feels like it takes forever
130
Joel Clermont @jclermont.com · 22/09/2026
Once you pin a GitHub Action to a specific commit, how do you find out if that version has a security problem? Let's look at a tool that can tell you. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Is there a composer audit for GitHub Actions? | Mastering Laravel
GitHub's built-in answer isn't quite enough
000
Joel Clermont @jclermont.com · 21/09/2026
Aaron and I disagreed about how to reference third-party actions in our GitHub workflows. One side has a real-world attack to point at. Let's look at both arguments. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Should you pin GitHub Actions to a commit hash? | Mastering Laravel
Aaron and I argued about it
020
Joel Clermont @jclermont.com · 18/09/2026
Not every factory field requires a named state. Here's the simple rule I use to decide which ones do, and why I still add a state for the default value. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
A good rule for when to create a factory state | Mastering Laravel
Make your tests more readable
000
Joel Clermont @jclermont.com · 17/09/2026
Here's a fun little exercise to see if your code could be improved. Read it out loud. Let's look at an example that demonstrates it. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Write code the way you say it | Mastering Laravel
Listen to the code before you refactor it
010
Joel Clermont @jclermont.com · 16/09/2026
Importing old data into a stricter MySQL server can fail on things like zero dates. Here's how to relax sql_mode for just the import session, without changing the server's configuration. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Loading a SQL backup without altering your configuration | Mastering Laravel
Sometimes data is messy
020
Joel Clermont @jclermont.com · 15/09/2026
A queued job that manually builds an expensive service is painful to test. Let's see how to leverage Laravel's container to make this a lot nicer. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
The right place to inject a service into a queued job | Mastering Laravel
And why it's the better choice
010
Joel Clermont @jclermont.com · 14/09/2026
Ever notice that some Docker containers stop instantly while others hang for ten seconds? I'll explain why and show how to fix it. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Why are some Docker containers slower to restart? | Mastering Laravel
And how do you fix it?
010
Joel Clermont @jclermont.com · 11/09/2026
Laravel doesn't require a primary key on a pivot table, and the relationship works fine without one. Here's why I add one anyway, and the replication problem it avoids. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Why I always add a primary key to many-to-many tables | Mastering Laravel
Even when Laravel doesn't require it
001
Joel Clermont @jclermont.com · 10/09/2026
After adding Compose watch to a project, every rebuild paused for ten seconds before the new container came up. If your restarts drag like that, here's a workaround that may help improve speed. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
A quick fix for slow Docker container restarts | Mastering Laravel
Compose may be waiting on a signal your dev server never handles
010
Joel Clermont @jclermont.com · 09/09/2026
When another site loads your built JS assets, Laravel never sees the request, so its CORS config can't help. Here's how to add the headers in Nginx for just those files, without slowing down everything else. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
How to set CORS headers for built assets | Mastering Laravel
And do it efficiently
000
Joel Clermont @jclermont.com · 08/09/2026
I joined a project where the Vue front end was built into the Docker image with no bind mount, so every change meant a manual rebuild. One addition to the compose file turned that back into a normal dev loop. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Stop rebuilding your Docker image after every front-end change | Mastering Laravel
A Compose feature for projects that skip the bind mount
010
Joel Clermont @jclermont.com · 07/09/2026
Ever handed off a feature request with barely any detail and expected the developer to just figure it out? In this week's podcast, Aaron and I make the case for writing requirements before development starts, and why letting AI write them for you is a trap. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Write better requirements or pay for it later | Mastering Laravel
Even imperfect requirements beat none at all
000
Joel Clermont @jclermont.com · 04/09/2026
If another site loads a script built by your Laravel app, switching to Vite can quietly break it. Here's the CORS gotcha we hit and how we fixed it. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Something to know if serving scripts for other sites | Mastering Laravel
Especially if you moved to Vite
030
Joel Clermont @jclermont.com · 03/09/2026
Laravel serializes a model's loaded relationships when you queue a job, but not when you queue a collection of models. Here's the right way to load relationships inside the job. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Loading relationships inside a queued job | Mastering Laravel
Do it the Laravel way
000
Joel Clermont @jclermont.com · 02/09/2026
Sometimes multiple controller actions need the same guard logic, but it doesn't belong in a policy or form request. Here's a clean way to share redirect logic without messy hacks. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Sharing redirect logic between controller actions | Mastering Laravel
Without resorting to messy hacks
010
Joel Clermont @jclermont.com · 01/09/2026
Pennant defaults to the database driver, but not every feature flag needs a table row and a query. Today's tip shows when the array driver is the lighter choice. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
You don't always need to put Pennant in the database | Mastering Laravel
The array driver keeps simple toggles lightweight
020
Joel Clermont @jclermont.com · 01/09/2026
Pennant defaults to the database driver, but not every feature flag needs a table row and a query. Today's tip shows when the array driver is the lighter choice. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
You don't always need to put Pennant in the database | Mastering Laravel
The array driver keeps simple toggles lightweight
010
Joel Clermont @jclermont.com · 31/08/2026
Converting an Eloquent casts property to the newer casts method looks like a pure style choice for which syntax you prefer, but here's a real-world example where the two behave differently. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
When new syntax is not actually equivalent functionality | Mastering Laravel
New syntax, same behavior. Usually.
000
Joel Clermont @jclermont.com · 28/08/2026
Dropping an index in a down migration usually means guessing at its name. Today's tip shows a cleaner way that lets Laravel figure it out for you. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
A better way to drop a unique index | Mastering Laravel
It involves less guesswork
010
Joel Clermont @jclermont.com · 27/08/2026
Laravel redirects back to the previous page when validation fails, but what happens when there is no sensible previous page? Today's tip covers a redirect loop that shows up with bookmarks and new tabs, and a simple way to stop it. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
When a validation failure causes a redirect loop | Mastering Laravel
Bookmarks and new tabs break the usual redirect back
000
Joel Clermont @jclermont.com · 26/08/2026
Automated tests catch most bugs, but not all of them. Today's tip is a reminder of why I still click through the app before pushing my code. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Manual testing still has its place | Mastering Laravel
Put yourself in the shoes of your users
010
Joel Clermont @jclermont.com · 25/08/2026
JSON language files use the string itself as the key, so where does the pluralization pipe go? Today's tip shows it works exactly like array files, once you get past how strange it looks. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Pluralization works in JSON language files | Mastering Laravel
Even though the keys feel like identifiers
030
Joel Clermont @jclermont.com · 24/08/2026
Ever been told your slow app just needs caching? In this week's podcast, Aaron and I break down the layers of caching in a Laravel app, from the Cloudflare edge down to in-request memoization. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Which layer of caching does your slow app actually need? | Mastering Laravel
There's more to caching than the Cache facade
010
Joel Clermont @jclermont.com · 21/08/2026
In today's video, watch a paginated list quietly show some records twice while never showing others, and see the one-line fix that makes pagination deterministic. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Why pagination sometimes has overlapping pages | Mastering Laravel
A deeper look inside the database
010
Joel Clermont @jclermont.com · 20/08/2026
Most factory states just flip a flag, but they can also accept arguments. That opens up some useful patterns, like deriving test data from another model. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Factory states can accept arguments | Mastering Laravel
Less boilerplate when building related test data
010
Joel Clermont @jclermont.com · 19/08/2026
You don't need to obsess over your site analytics, but an occasional look can pay off. One glance at ours revealed a stranger already selling our book for us. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Pay attention to analytics | Mastering Laravel
There can be some interesting insights
010
Joel Clermont @jclermont.com · 18/08/2026
Composer insisted the class didn't exist, but it was sitting right there in the vendor folder. The problem was the package, but I'll explain how we fixed it with Composer and why we picked the approach we did. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
When Composer can't find a class that exists | Mastering Laravel
Reach for classmap, not files
000
Joel Clermont @jclermont.com · 17/08/2026
When your app is behind a reverse proxy, it might seem like an easy fix to just force HTTPS to make your links render correctly, but it totally ignores other important behavior that remains broken, like rate limiting. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
The downside of just forcing HTTPS when behind a reverse proxy | Mastering Laravel
You mess up other important behavior
010
Joel Clermont @jclermont.com · 14/08/2026
In today's video, watch a listener with the wrong import silently stop working, with no errors anywhere, and see the one-line test that catches it instantly. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Make sure your listeners are wired up | Mastering Laravel
Without this simple test, nothing else matters
010
Joel Clermont @jclermont.com · 13/08/2026
You pass a model to Mockery's with() and the test fails, even though your code called the service with the right model. Here's a cleaner way to match it. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
When Mockery says your Eloquent model doesn't match | Mastering Laravel
Let Eloquent's is() method do the comparison
020
Joel Clermont @jclermont.com · 12/08/2026
Ever have a test that fails once out of 500 runs, then passes when you run it again? The test value you picked might be colliding with random Faker data. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Picking a good test value | Mastering Laravel
And avoid flaky tests
000
Joel Clermont @jclermont.com · 11/08/2026
A validation test that only asserts an error on the field can keep passing long after the rule it covers breaks. Here's how to tighten up that assertion. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Is your validation test passing for the wrong reason? | Mastering Laravel
Assert the specific rule, not just the field
010
Joel Clermont @jclermont.com · 10/08/2026
Ever fixed a failing test by tossing a variable into phpunit.xml and moving on? In this week's podcast, Aaron and I debate which env values belong there and which ones never should. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Where do credentials end and configuration begin in your env file? | Mastering Laravel
Not every env variable belongs in phpunit.xml
000
Joel Clermont @jclermont.com · 07/08/2026
Ever open a large feature test and struggle to find the method you're looking for? Today's tip shares the consistent ordering we follow so every test file feels instantly familiar. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Consistent test organization | Mastering Laravel
I like patterns
020
Joel Clermont @jclermont.com · 06/08/2026
Laravel 13's cache hardening is a nice improvement, but it can break existing apps in silent ways. Here's a safe approach you can use to improve security and alert you if you missed something. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Adopting Laravel's hardened cache default in a large app | Mastering Laravel
With a safety net in case you miss something
010
Joel Clermont @jclermont.com · 05/08/2026
Constructor property promotion is one of my favorite PHP features, but there's one situation where I still declare class properties the old way. It keeps the intent of the code clearer. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
One place I avoid constructor property promotion | Mastering Laravel
Just to keep the intent clear
010
Joel Clermont @jclermont.com · 04/08/2026
Laravel 13 ships with a hardened cache serialization default. It's a real security win, but when it breaks, you don't get an exception. Here's how it works and what to watch for. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
The sneaky failure mode in Laravel 13's hardened cache | Mastering Laravel
A cache hit can now hand you a broken object instead of your data
021
Joel Clermont @jclermont.com · 03/08/2026
Attackers have been abusing PHP object deserialization since before Laravel existed. Here's how those attacks work, and a way to protect against them. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Why unserialize is on every PHP security checklist | Mastering Laravel
Rebuilding an object from a string can run code you never intended
031
Joel Clermont @jclermont.com · 31/07/2026
Do you really need dozens of migration files before your app even launches? Today's tip shares how we handle a fast-changing schema in the early days of a new project. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
How we use migrations during early product development | Mastering Laravel
When the schema changes quickly
010
Joel Clermont @jclermont.com · 30/07/2026
We use UI toolkits to help us make styling decisions easier, but does this mean we always accept their decisions? Let me share a recent example where I pushed back on the defaults. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Does this field look readonly to you? | Mastering Laravel
A UI toolkit's defaults are still your design decisions
010
Joel Clermont @jclermont.com · 29/07/2026
Ever been tempted to make a property public just so a test can assert on it? Today's tip shares a rule we follow on every project, and the trick that lets you keep your tests isolated without touching application code. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Avoid changing your code purely for a test | Mastering Laravel
Even if it's just to make a property public
020
Joel Clermont @jclermont.com · 28/07/2026
Ever mock a facade and have your macro mysteriously disappear? Today's tip shows a technique for testing macros you've added to classes you don't own. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
How to test a macro on a class you don't own | Mastering Laravel
A partial mock keeps Macroable working
011
Joel Clermont @jclermont.com · 27/07/2026
Would you let an AI agent run commands on your production server? In this week's podcast, Aaron and I explain why that's just as reckless as FTPing code straight to production. masteringlaravel.io/daily/2026-0...
masteringlaravel.io
Running AI agents on your production server is the new FTP | Mastering Laravel
Fast and efficient, but with zero responsibility
210