NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #4096 most downloaded on Packagist
Data Transfer Objects with validation for Laravel applications
Latest stable
v4.7.0
Last release 6 months ago
26 May 2026
Ships fairly regularly
a new release about every 2 months
Most releases are documented
notes for 37 of 58 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
58 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Update Laravel badge link style in README by @peterfox in https://github.com/WendellAdriel/laravel-validated-dto/pull/123
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.6.0...v4.7.0
Added package-specific publish tags: validated-dto , validated-dto-config , and validated-dto-stubs .
Updated the dto:stubs command to use the new validated-dto-stubs publish tag.
Add Laravel Validated DTO development skill by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/122
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.5.0...v4.6.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Laravel 13 support by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/121
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.4.1...v4.5.0
Add classReflections to forbidden properties in SimpleDTO by @ricazao in https://github.com/WendellAdriel/laravel-validated-dto/pull/119
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.4.0...v4.4.1
Add new SkipOnTransform attribute by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/118
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.3.0...v4.4.0
Add Lazy, Provide and Receive attributes by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/117
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.2.2...v4.3.0
Added new Lazy attribute.
Added new Provide attribute.
Added new Receive attribute.
Fix issue when using DTOCast with Cast attribute by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/115
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.2.1...v4.2.2
Fixed issue with Serialization and removed the internal annotation from the ResourceCollection class. Full Changelog: https://github.com/WendellAdriel
Fixed issue with Serialization and removed the internal annotation from the ResourceCollection class.
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.2.0...v4.2.1
Fix issue of missing nested DTO properties when transforming DTO by @MasterFelX in https://github.com/WendellAdriel/laravel-validated-dto/pull/108
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.1.0...v4.2.0
Generate typescript definitions by @benbjurstrom in https://github.com/WendellAdriel/laravel-validated-dto/pull/102
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v4.0.0...v4.1.0
Support for Laravel 12 by @patriziotomato in https://github.com/WendellAdriel/laravel-validated-dto/pull/103
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.10.3...v4.0.0
Added support for Laravel 12.
Removed support for Laravel 9 and 10.
Removed support for PHP 8.1, minimum version now is 8.2.
Removed custom transformModelToArray function by @felixbessler in https://github.com/WendellAdriel/laravel-validated-dto/pull/98
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.10.2...v3.10.3
Fixes missing JsonSerializable implementation by @serogaq in https://github.com/WendellAdriel/laravel-validated-dto/pull/95
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.10.1...v3.10.2
Fix issue of missing properties when transforming DTO by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/94
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.10.0...v3.10.1
Add lazy validation feature by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/92
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.9.0...v3.10.0
Fix issue with data property by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/91
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.8.1...v3.9.0
Fixing issue 85 - Declaration of WendellAdriel\ValidatedDTO\SimpleDTO… by @patriziotomato in https://github.com/WendellAdriel/laravel-validated-dto/pu
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.8.0...v3.8.1
Added support for Arrayable by @felixbessler in https://github.com/WendellAdriel/laravel-validated-dto/pull/84
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.7.1...v3.8.0
Preserve timezone offset for Carbon casts by @schaeferalex in https://github.com/WendellAdriel/laravel-validated-dto/pull/83
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.7.0...v3.7.1
Switched buildDataForExport from private to protected for custom DataTransformers by @felixbessler in https://github.com/WendellAdriel/laravel-validat
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.6.1...v3.7.0
Fix issue with toArray by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/80
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.6.0...v3.6.1
Clearing data property after DTO validation by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/79
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.5.2...v3.6.0
fix number cast when post empty string by @szutoutou in https://github.com/WendellAdriel/laravel-validated-dto/pull/76
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.5.1...v3.5.2
read custom stubs in case developer require custom stubs by @MarkRady in https://github.com/WendellAdriel/laravel-validated-dto/pull/75
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.5.0...v3.5.1
Laravel 11 by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/74
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.4.0...v3.5.0
Customizable stubs by @DavoodGhanbarpour in https://github.com/WendellAdriel/laravel-validated-dto/pull/69
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.3.0...v3.4.0
Added the dto:stubs command to publish the DTO stubs to be customized.
Fixed issue with file validation.
Add after hook for validation by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/60
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.2.1...v3.3.0
Fix how to handle enums and carbon objects when transforming DTO by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/59
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.2.0...v3.2.1
Add new Cast attribute by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/55
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.1.2...v3.2.0
Fix issue when transforming DTOs with nested Collections or Models by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/54
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.1.1...v3.1.2
Fix issue when transforming DTOs with nested DTOs into array or json by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.1.0...v3.1.1
Added new Attributes and Traits by @WendellAdriel in https://github.com/WendellAdriel/laravel-validated-dto/pull/51
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.0.1...v3.1.0
Added the Rules attribute to define custom validation rules for DTO properties.
Added the DefaultValue attribute to define default values for DTO properties.
Added the Map attribute to define the custom mapping for DTO properties.
Added the EmptyCasts trait to be used by DTOs that don't have any casts.
Added the EmptyRules trait to be used by DTOs that don't have any validation rules or that are using the Rules attribute for validation.
Added the EmptyDefaults trait to be used by DTOs that don't have any default values or that are using the DefaultValue attribute for default values.
Use a return type of static by @simon-tma in https://github.com/WendellAdriel/laravel-validated-dto/pull/48
static by @simon-tma in https://github.com/WendellAdriel/laravel-validated-dto/pull/48Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v3.0.0...v3.0.1
Added logo files by @scottzirkel in https://github.com/WendellAdriel/laravel-validated-dto/pull/43
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v2.11.1...v3.0.0
Use DTO as it was a Form Request
Ability to customize the path/namespace of the generated DTOs.
DTO classes generated with the make command are slimmer.
Ability to cast array items when using the ArrayCast .
New EnumCast for casting values to Enums. Work with UnitEnum and BackedEnum .
mapBeforeValidation() was renamed to mapData() .
mapBeforeExport() was renamed to mapToTransform() .
->toJson() method now returns a JSON string without any formatting. Use ->toPrettyJson() instead.
tests :: refactor some tests by @falahatiali in https://github.com/WendellAdriel/laravel-validated-dto/pull/39
Full Changelog: https://github.com/WendellAdriel/laravel-validated-dto/compare/v2.11.0...v2.11.1
Added the support for defining custom casting with callables/callbacks
callables/callbacksYou can now create new Castable types for your project by using a callable/callback:
class CustomDTO extends ValidatedDTO
{
protected function rules(): array
{
return [
'url' => ['required', 'url'],
];
}
protected function defaults(): array
{
return [];
}
protected function casts(): array
{
return [
'url' => function (string $property, mixed $value) {
return new URLWrapper($value);
},
];
}
}
Added a new ResourceDTO class that you can use to wrap, type and transform your API responses
If you want to use DTOs to wrap, type and transform your API responses, you can use the ResourceDTO class.
This class will have the same features as the SimpleDTO class and will implement the Illuminate\Contracts\Support\Responsable interface:
class UserResourceDTO extends ResourceDTO
{
public string $name;
public string $email;
public int $age;
// Your DTO methods...
}
Then you can return your DTOs from your controllers:
class UserController extends Controller
{
public function show(int $id)
{
return UserResourceDTO::fromModel(User::findOrFail($id));
}
}
You can also return a collection/list of your DTOs as a response using the ResourceDTO::collection() method:
class UserController extends Controller
{
public function index()
{
return UserResourceDTO::collection(User::all());
}
}
This way every item in the collection will be converted to a UserResourceDTO instance before sending
the response to the client, using all the typing, casting and mapping features of your DTO class.
To generate a ResourceDTO you can use the --resource flag:
php artisan make:dto UserResourceDTO --resource
If you're using Laravel Livewire, you can turn your DTOs into wireable DTOs
by adding the WendellAdriel\ValidatedDTO\Concerns\Wireable trait to your DTOs:
class UserDTO extends ValidatedDTO
{
use Wireable;
// Your DTO code...
}
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.