DDD Value Objects &amp; DTOs in Laravel Without Bloat | Mohamed Said        [  ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png)   Mohamed Said Laravel Backend Engineer  ](https://www.msaied.com) [ Home ](https://www.msaied.com) [ Projects ](https://www.msaied.com/projects) [ Articles  ](https://www.msaied.com/articles) [ Certificates ](https://www.msaied.com/certificates) [ Contact ](https://www.msaied.com#contact-section) 

       [  ](https://github.com/EG-Mohamed)       

 [ Home ](https://www.msaied.com) [ Projects ](https://www.msaied.com/projects) [ Articles ](https://www.msaied.com/articles) [ Certificates ](https://www.msaied.com/certificates) [ Contact ](https://www.msaied.com#contact-section) 

  [ home ](https://www.msaied.com)    [ articles ](https://www.msaied.com/articles)    DDD Value Objects and DTOs in Laravel Without the Bloat        On this page       1. [  The Problem With Anemic Domain Models ](#the-problem-with-anemic-domain-models)
2. [  Value Objects: Identity Through Value ](#value-objects-identity-through-value)
3. [  Casting Value Objects in Eloquent ](#casting-value-objects-in-eloquent)
4. [  DTOs: Typed Input Boundaries ](#dtos-typed-input-boundaries)
5. [  Why Not Spatie Data? ](#why-not-spatie-data)
6. [  Takeaways ](#takeaways)

  ![DDD Value Objects and DTOs in Laravel Without the Bloat](https://cdn.msaied.com/450/41688537085b86f102fd8c219a35319f.png)

  #laravel   #ddd   #php   #architecture   #clean-code  

 DDD Value Objects and DTOs in Laravel Without the Bloat 
=========================================================

     21 Jul 2026      1 min read    ![Mohamed Said](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MJ.jpg)  Mohamed Said  

       Table of contents

1. [  01   The Problem With Anemic Domain Models  ](#the-problem-with-anemic-domain-models)
2. [  02   Value Objects: Identity Through Value  ](#value-objects-identity-through-value)
3. [  03   Casting Value Objects in Eloquent  ](#casting-value-objects-in-eloquent)
4. [  04   DTOs: Typed Input Boundaries  ](#dtos-typed-input-boundaries)
5. [  05   Why Not Spatie Data?  ](#why-not-spatie-data)
6. [  06   Takeaways  ](#takeaways)

 The Problem With Anemic Domain Models
-------------------------------------

Most Laravel codebases pass raw arrays or plain Eloquent models between layers. This works until it doesn't: you find yourself writing `$data['email']` in five controllers, validating the same format in three places, and debugging a `null` that should never have been allowed in.

Domain-driven design offers two lightweight tools that fix this without requiring a framework: **value objects** and **DTOs**. PHP 8.3 readonly classes make both feel native.

Value Objects: Identity Through Value
-------------------------------------

A value object has no identity beyond its data. Two `Money` instances with the same amount and currency are equal. They are immutable by definition.

```php
