Search a title or topic

Over 20 million podcasts, powered by 

Player FM logo
Artwork

Content provided by Joel Clermont and Aaron Saray. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Joel Clermont and Aaron Saray or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://podcastplayer.com/legal.
Player FM - Podcast App
Go offline with the Player FM app!

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

11:02
 
Share
 

Manage episode 497837297 series 2974897
Content provided by Joel Clermont and Aaron Saray. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Joel Clermont and Aaron Saray or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://podcastplayer.com/legal.

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?
  continue reading

132 episodes

Artwork
iconShare
 
Manage episode 497837297 series 2974897
Content provided by Joel Clermont and Aaron Saray. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Joel Clermont and Aaron Saray or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://podcastplayer.com/legal.

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?
  continue reading

132 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Copyright 2025 | Privacy Policy | Terms of Service | | Copyright
Listen to this show while you explore
Play