Using it we can create better and more cohesive Domain Model.

Embeddable let’s you aggregate some properties, that are linked together in some way, into one cohesive class. You may say — well, I can create another entity and create a relation, what is the difference?

Only the properties that had to be mutated in some way will point to another object somewhere else in memory.

If you will need to implement identity in some class in other way, you will just not extend this one.
Newsletter

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

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners