Skip to content

Releases: open-southeners/laravel-dto

1.8.3

26 Sep 09:25
49540fe
Compare
Choose a tag to compare

Fixed

  • Issue mapping custom objects from data collections (native arrays or Illuminate's collections)

1.8.2

22 Sep 10:00
a37aed9
Compare
Choose a tag to compare

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

12 Sep 15:37
dcf942e
Compare
Choose a tag to compare

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 context
  • DataTransferObject::toArray() method now returns arrays with nested toArray calls when collections or models

1.8.0

07 Sep 08:43
02ea510
Compare
Choose a tag to compare

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 or Carbon\Carbon or Carbon\CarbonImmutable instances

1.7.1

01 Sep 15:02
9d72632
Compare
Choose a tag to compare

Fixed

  • Laravel collections not being mapped properly
  • Arrays not mapping properly when not containing strings (arrays with arrays inside)

1.7.0

01 Sep 09:24
40a9b6a
Compare
Choose a tag to compare

Added

  • Command option --request to create ValidatedDataTransferObject with request method in it.

1.6.0

31 Aug 14:47
dac7718
Compare
Choose a tag to compare

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

10 Aug 14:50
13425b1
Compare
Choose a tag to compare

Fixed

  • Minor issue, now doesn't query when sending model instance using DataTransferObject::fromArray() method

1.5.0

02 May 11:38
3bdeceb
Compare
Choose a tag to compare

Changed

  • Properties returned from toArray are now snake cased (from myPropertyName to my_property_name)
  • Improved toArray to return just some modified properties (from defaults)

1.4.1

26 Apr 14:33
bbd4e45
Compare
Choose a tag to compare

Added

  • toArray method to DTOs

Fixed

  • BindModelWith attribute on collection typed properties