Skip to content
Advertisement

Tag: dto

Custom validator for email doesn’t throw exception when validating an invalid email address on a Spatie DTO object

I’m currently working on an integration with a third party API for an application, for which I’m using Spatie’s data transfer object library. I’m currently looking to set up validation for some fields, and have run into an issue. I’ve written the following validator attribute, to validate that a string contains an email address: And it’s used in this DTO

Extracting data from DDD Entity/Aggregate

Can someone please clarify the following topic? I haven’t found enough complex answer to this, just some basic examples of how this should work, so I am asking here. Let’s say we have an entity Invoice. The Invoice has some private props like date issued, payment date, Items, etc. By the principle of DDD the Domain should care only about

Advertisement