No Compromises

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


Listen Later

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?
    ...more
    View all episodesView all episodes
    Download on the App Store

    No CompromisesBy Joel Clermont and Aaron Saray

    • 4.9
    • 4.9
    • 4.9
    • 4.9
    • 4.9

    4.9

    8 ratings


    More shows like No Compromises

    View all
    The Laravel Podcast by Taylor Otwell, Matt Stauffer

    The Laravel Podcast

    58 Listeners

    Startups For the Rest of Us by Rob Walling

    Startups For the Rest of Us

    701 Listeners

    Darknet Diaries by Jack Rhysider

    Darknet Diaries

    8,078 Listeners

    Notes On Work - by Caleb Porzio by Caleb Porzio

    Notes On Work - by Caleb Porzio

    18 Listeners

    The Stack Overflow Podcast by The Stack Overflow Podcast

    The Stack Overflow Podcast

    62 Listeners

    The Bootstrapped Founder by Arvid Kahl

    The Bootstrapped Founder

    35 Listeners

    All-In with Chamath, Jason, Sacks & Friedberg by All-In Podcast, LLC

    All-In with Chamath, Jason, Sacks & Friedberg

    10,260 Listeners

    Hard Fork by The New York Times

    Hard Fork

    5,592 Listeners

    Mostly Technical by Ian Landsman and Aaron Francis

    Mostly Technical

    27 Listeners