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.
Community Partners