Releases: open-southeners/laravel-dto
Releases · open-southeners/laravel-dto
1.8.3
Fixed
- Issue mapping custom objects from data collections (native arrays or Illuminate's collections)
1.8.2
Added
make:dto --request
command now accepts empty request option to create empty base DTO class with empty request method
Fixed
make:dto --request
now fill request method properly
1.8.1
Fixed
- Collections binding models were returning model instance instead of array or
Illuminate\Support\Collection
with the models inside DataTransferObject::filled()
method now checks within route parameters as well as sent request body data if is within request contextDataTransferObject::toArray()
method now returns arrays with nestedtoArray
calls when collections or models
1.8.0
Added
php artisan make:dto --request='App\Http\Requests\PostCreateFormRequest' PostCreateData
will now fill the request part and all properties for you with their types (experimental)- Map arrays or json strings into generic objects (
\stdClass
) or custom objects (using their classes) - Map string dates into
Illuminate\Support\Carbon
orCarbon\Carbon
orCarbon\CarbonImmutable
instances
1.7.1
Fixed
- Laravel collections not being mapped properly
- Arrays not mapping properly when not containing strings (arrays with arrays inside)
1.7.0
Added
- Command option
--request
to createValidatedDataTransferObject
with request method in it.
1.6.0
Added
- Add binding resolution so DataTransferObjects can act as validated requests using
ValidatedDataTransferObject
interface - Add authenticated user “automagical” binding to
DataTransferObject
property when possible (need to be typed as Authenticatable illuminate's contract)
Changed
- Now route parameters are merged into DataTransferObjects when running within requests context
1.5.1
Fixed
- Minor issue, now doesn't query when sending model instance using
DataTransferObject::fromArray()
method
1.5.0
Changed
- Properties returned from
toArray
are now snake cased (frommyPropertyName
tomy_property_name
) - Improved
toArray
to return just some modified properties (from defaults)
1.4.1
Added
toArray
method to DTOs
Fixed
BindModelWith
attribute on collection typed properties