Generated DTOs target PHP 8.2+ and can use readonly for immutability.
When $config->phpReadonly = true and constructor generation is enabled, model templates emit class-level readonly DTOs where possible.
Example:
readonly class Pet
{
public function __construct(
public int $id,
public string $name,
public ?string $tag = null,
) {
}
}
toArray().$config->phpReadonly = false.