In our previous blog post we set up our Laravel application to use Domain Driven Design, and we did this in a way that would let us expand and add new domains as and when we needed nicely. This article is taking that next step, creating our domain code. We will being this part of the journey by creating data objects and data object factories.

Data Objects are just plain old php objects that give us more context and control than your typical array would do. Imagine the following example: $post = [ 'title' => 'My Post Title', 'content' => 'This is the post content', 'published' => true, ]; Now imagine we passed this array into a method to publish it.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners