Changing your mind about when() and unless() in Eloquent episode artwork

EPISODE · Aug 2, 2025 · 11 MIN

Changing your mind about when() and unless() in Eloquent

from No Compromises · host Joel Clermont and Aaron Saray

Aaron admits he used to wrap every query in plain old if-statements—until Laravel’s when()/unless() helpers (and arrow functions) won him over. He and Joel compare their journeys, debate readability trade-offs, and share guidelines for deciding which style to use. Along the way they discuss false assumptions, evolving “code grammar,” and how tools such as Rector can automate the switch.(00:00) - Intro – refining long-held opinions (00:45) - Aaron’s original “query-then-if” pattern (01:45) - Why when() first felt clumsy (closures, scopes, extra params) (03:45) - Arrow functions & smaller conditions make when() nicer (05:00) - Joel’s lingering objection: avoiding unless() for readability (06:45) - Seeing the same helper everywhere changes minds (08:30) - Takeaways – keep revisiting old habits as Laravel evolves (09:30) - Silly bit Want help learning how to more quickly refactor and standardize your app with Rector?

Episode metadata supplied by the publisher feed · Published Aug 2, 2025

Embed this episode

NOW PLAYING

Changing your mind about when() and unless() in Eloquent

0:00 11:02

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

No similar episodes found.

No similar podcasts found.

Frequently Asked Questions

How long is this episode of No Compromises?

This episode is 11 minutes long.

When was this No Compromises episode published?

This episode was published on August 2, 2025.

Is there a transcript available for this episode?

Yes, a full transcript is available for this episode. You can read the complete transcript on the episode page.

Can I download this No Compromises episode?

Yes. Use the download control on the episode player to save the publisher-provided media file.
URL copied to clipboard!