Laravel Action Data v2.0.0
This major release improves Laravel-native validation behavior and makes DTO serialization reliable for nested structures.
Highlights
Integrated Laravel ValidationException for attribute-based validation.
Improved toArray behavior with recursive conversion for nested DTOs and arrays of DTOs.
Validation errors now follow Laravel standard field-based error formatting.
Better API consistency and developer experience in Laravel applications.
What's Changed
Breaking Changes
- validateAttributes now throws Illuminate ValidationException instead of InvalidArgumentException.
- Existing try/catch logic that handles attribute validation errors must be updated accordingly.
Migration Guide
- Replace InvalidArgumentException catches used for DTO attribute validation with ValidationException.
- If you use Laravel default exception handling, no custom error formatting is required for 422 responses.
- Keep custom handlers only if you need a non-standard error response shape.
Compatibility
PHP: 8.3+
Laravel: 12.x and 13.x
Full Changelog: v1.2.1...v2.0.0