No Compromises

Should you use DTOs in Laravel?


Listen Later

DTOs (Data Transfer Objects) aren't mentioned anywhere in the Laravel docs, but some devs use them heavily in their applications, whereas other devs never use them at all.

In the latest episode of the No Compromises podcast, we weigh the pros and cons of DTOs in everyday Laravel apps, comparing them to form requests, PHPDoc-typed arrays, and service-layer boundaries, and share one area where DTOs truly shine.

The takeaway: keep DTOs in the toolbox, but reach for them intentionally, not by habit.

  • (00:00) - Framing DTOs in a stricter PHP world
  • (01:15) - Our current practice: hybrids, few true DTOs
  • (02:45) - Form requests, `safe()`, and typed inputs
  • (03:45) - Reuse across API and form layers rarely aligns
  • (04:30) - Where DTOs shine: normalizing multiple APIs
  • (05:45) - Service boundaries: wrapping vendor objects (e.g., Stripe)
  • (06:15) - PHPDoc-typed arrays vs DTO overhead
  • (06:45) - Conventions, Larastan levels, and avoiding ceremony
  • (07:45) - Treat DTOs as a tool, not a rule
  • (09:15) - Silly bit

  • Want to discuss how we can help you with an architecture review?
    ...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

    57 Listeners

    Startups For the Rest of Us by Rob Walling

    Startups For the Rest of Us

    710 Listeners

    Darknet Diaries by Jack Rhysider

    Darknet Diaries

    8,088 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

    34 Listeners

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

    All-In with Chamath, Jason, Sacks & Friedberg

    10,104 Listeners

    Hard Fork by The New York Times

    Hard Fork

    5,539 Listeners

    Mostly Technical by Ian Landsman and Aaron Francis

    Mostly Technical

    26 Listeners