Skip to content
← All examples

Domain + runtime adapter foundation

Talred Forge

The Talred foundation: a runtime framework-adapter resolver, DDD primitives and application contracts shared by HTTP and CQRS. Build self-protecting domain models with framework services integrated through adapters.

  • PHP 8.2+
  • Laravel
  • PHP Attributes
  • PSR-11
  • DDD

What it includes

  • Value Objects, Entities and Aggregates
  • Composable Rules and Specifications
  • Transformers, Invariants and Policies
  • Automatic framework-adapter discovery

Code example

Attributes define transformation and validation close to the value, so external input becomes a normalised, self-protecting domain object.

final class Email extends ValueObject
{
    public function __construct(
        #[Transform(EmailNormalizer::class, ['lowercase' => true])]
        #[UseSpecification(EmailFormatSpecification::class)]
        public readonly string $address,
    ) {}
}

$email = Email::resolve(['address' => '  [email protected]  '])