Joel Clermont's Avatar

Joel Clermont

@jclermont.com

๐Ÿ“– Author of Mastering Laravel Validation Rules โœ๏ธ I post useful Laravel tips https://masteringlaravel.com ๐ŸŽ™๏ธ Co-host of https://show.nocompromises.io podcast ๐Ÿ˜ Organizer of Milwaukee PHP

3,589
Followers
168
Following
908
Posts
25.04.2023
Joined
Posts Following

Latest posts by Joel Clermont @jclermont.com

Preview
Eager loading, but only if you really need to | Mastering Laravel A one-word change to eliminate duplicate queries

In today's video, I show you a one-word change that can eliminate duplicate eager loading queries in your Laravel app. masteringlaravel.io/daily/2026-0...

06.03.2026 14:15 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Let an AI agent dig through your git history | Mastering Laravel Old code is never truly gone when you have git and a smart assistant

Deleted code lives on in git history, and AI agents like Claude Code can search through it for you. Here's an example of finding old code when you're not even quite sure what to search for. masteringlaravel.io/daily/2026-0...

05.03.2026 13:51 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Try not to make things worse | Mastering Laravel Tidy as you go

When you find messy code, it's tempting to just work around it. But sometimes a small refactor now saves a lot of pain later. masteringlaravel.io/daily/2026-0...

04.03.2026 21:38 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Common objections to deleting dead code | Mastering Laravel Every one of them has a better alternative

When you suggest deleting dead code, someone always says "but what if I need it later?" Here are four common objections and why none of them hold up. masteringlaravel.io/daily/2026-0...

03.03.2026 13:46 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Dead code is costing you money | Mastering Laravel That commented-out block is more expensive than you think

Commented-out code and dead code might seem harmless, but they cost real money in wasted time and frustration. Here's why you should start deleting. masteringlaravel.io/daily/2026-0...

02.03.2026 12:53 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Route binding with two different models | Mastering Laravel Let the framework do the heavy lifting

In today's video, I show how to use Laravel's explicit route model binding to resolve a single URL parameter to one of two different models, no polymorphism required. masteringlaravel.io/daily/2026-0...

27.02.2026 14:33 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Why are there two PSR4 mappings for the database directory? | Mastering Laravel It all comes down to a single capital letter

Ever wondered why Laravel's composer.json has separate PSR-4 entries for Database\Factories and Database\Seeders instead of just one Database mapping? masteringlaravel.io/daily/2026-0...

26.02.2026 13:58 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Are fast queries always good? | Mastering Laravel I mean, yeah! Right? Well, there's more to the story...

We all want fast database queries, but are they always better? Hold your judgement and give this a quick read. masteringlaravel.io/daily/2026-0...

25.02.2026 15:04 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Make sure you know how orWhere works with multiple values | Mastering Laravel A real world example

Depending on your expectations, passing an associative array to Eloquent's orWhere method might not do what you think. Here's a real bug I found and the simple fix. masteringlaravel.io/daily/2026-0...

24.02.2026 13:37 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Three ways to plan an upgrade when your codebase is a patchwork | Mastering Laravel Which approach gives you the best tradeoff?

When the same feature exists in three different styles across your codebase, how do you plan an upgrade? In this week's podcast, Aaron and I discuss three approaches and the tradeoffs of each. masteringlaravel.io/daily/2026-0...

23.02.2026 14:05 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Stop using $request->get() | Mastering Laravel There is a better way

In today's video, I show you why $request->get() can silently fail and what to use instead. masteringlaravel.io/daily/2026-0...

20.02.2026 14:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Do Eloquent subqueries work across database connections? | Mastering Laravel As is so often the case, it depends

A reader question about subqueries across multiple database connections led to an interesting deep dive into how Laravel compiles queries. It turns out whereHas and whereIn behave very differently here. masteringlaravel.io/daily/2026-0...

19.02.2026 13:15 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Clean up dead git branch references automatically | Mastering Laravel Git has an option for everything

Tired of stale branch references cluttering your local repo after merging PRs? There's a one-time git config to fix that. masteringlaravel.io/daily/2026-0...

18.02.2026 14:49 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Match your local database connections to production | Mastering Laravel Another cautionary tale

Once again, I missed a bug because the local dev environment was different from the server environment. Don't do it people, learn from my pain! masteringlaravel.io/daily/2026-0...

17.02.2026 13:25 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Eager loading can query the wrong database | Mastering Laravel A subtle trap when using multiple connections

If you use multiple database connections in Laravel, there's a subtle trap where eager loading can query the wrong database. Here's why it happens and the simple fix. masteringlaravel.io/daily/2026-0...

16.02.2026 14:02 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
What is the difference between boot and register in service providers | Mastering Laravel Where do I put this code?

Do you ever wonder if that code should go in the register or boot method in your service provider? In today's video, I explain the difference with real examples of what goes where and a common rule to make it easy to remember. masteringlaravel.io/daily/2026-0...

13.02.2026 13:38 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
How to tell if you're testing the framework | Mastering Laravel A quick way to check if your test has real value

A question came up on our YouTube channel about whether a test is really useful or just testing Laravel itself. Here's a simple trick I use to tell the difference. masteringlaravel.io/daily/2026-0...

12.02.2026 14:24 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
The value of a quick code demo | Mastering Laravel Sometimes it's more effective to show than tell

Before you type up that long explanation, consider recording a quick screencast instead. You might even catch a bug or two in the process. masteringlaravel.io/daily/2026-0...

11.02.2026 15:02 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Occasionally recheck your assumptions about Laravel behavior | Mastering Laravel Something that was broken for a decade now just works

Remember when limit() inside eager loading constraints didn't work per parent? Laravel 11 quietly fixed that. Time to retest your assumptions. masteringlaravel.io/daily/2026-0...

10.02.2026 13:49 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Stop doing math in your config files | Mastering Laravel Keep it boring, not clever

That 5 * 60 in your config file? Is it really necessary? In this week's podcast, Aaron and I explain why config values should be plain and static. masteringlaravel.io/daily/2026-0...

10.02.2026 01:25 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Even GitHub comments have version control | Mastering Laravel And it occasionally helps you win arguments

GitHub versions our code, but what about other important elements like issues and comments? In today's video, I show you how to see a version history for these elements too. masteringlaravel.io/daily/2026-0...

06.02.2026 17:03 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Be careful with ddRawSql | Mastering Laravel A handy debugging tool with a few caveats

ddRawSql() is great for quick debugging, but there are a few things to watch out for before you rely on it too heavily. masteringlaravel.io/daily/2026-0...

05.02.2026 16:09 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Don't get defensive during code review | Mastering Laravel Sometimes even a small observation can lead to a big improvement

A simple comment on a function name led to a much bigger refactoring. Here's why I've learned to welcome code review feedback instead of resisting it. masteringlaravel.io/daily/2026-0...

04.02.2026 23:07 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
When might you want to skip updating model timestamps? | Mastering Laravel Not every change is a real modification

The updated_at timestamp should mean something. What are some cases when I might skip updating the timestamps? Here are a couple examples. masteringlaravel.io/daily/2026-0...

03.02.2026 12:34 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
json_encode with non-consecutive array keys | Mastering Laravel Why your JSON arrays become objects after filtering

After filtering an array, your JSON response might turn from an array into an object. Here's why and how to fix it. masteringlaravel.io/daily/2026-0...

02.02.2026 17:03 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Failing tests give you confidence | Mastering Laravel Not just knowing it fails, but why

Test-driven development might seem impractical, especially if you're adding tests to existing code. In today's video, I show you how you can get some of the same TDD benefits even when writing tests after the code. masteringlaravel.io/daily/2026-0...

30.01.2026 16:08 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Think before changing application code for tests | Mastering Laravel There might be a better option

I had a test that was throwing an exception because a user was missing a role. My first inclination was to update the app logic to handle that case, but should that case even be possible? masteringlaravel.io/daily/2026-0...

29.01.2026 13:18 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Dealing with messy JSON | Mastering Laravel Sometimes APIs do unspeakable things and we have to work around it in our app

I've seen some scary things when dealing with various third-party APIS. Today I share a story of a particularly bad one, and how we worked around its messy JSON payload. masteringlaravel.io/daily/2026-0...

28.01.2026 14:21 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
Game Nโ€™ Repair under new ownership by family Game N' Repair in Cedarburg offers a variety of video games and console repairs. The store is now under new family ownership, providing a nostalgic gaming experience.

Nice write up by the local newspaper on our new family-run video game shop www.gmtoday.com/news_graphic...

27.01.2026 23:34 ๐Ÿ‘ 7 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0
Preview
Rule::exists vs Rule::unique | Mastering Laravel Maybe you don't need that custom rule

If your custom validation rule internally defers to an existing Laravel rule and just inverts the logic, you might be able to avoid the custom rule altogether. Notice what I found in a recent code review. masteringlaravel.io/daily/2026-0...

27.01.2026 14:30 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0