Skip to content

Releases: open-southeners/laravel-dto

3.0.0

16 Oct 17:38
3c5f84c
Compare
Choose a tag to compare

Added

  • Morph support for data transfer objects model properties and collection properties. For e.g: public Film|Post $taggable, public string $taggableType
  • Simplificated OpenSoutheners\LaravelDto\Attributes\BindModel attribute grouping all the model binding options.
  • Support for OpenSoutheners\LaravelDto\Attributes\BindModel attribute in morph properties, which can be also used to customise the type key name. For e.g. from the same example from above:
#[BindModel(
  using: [Post::class => 'slug'],
  with: [Post::class => 'tags', Film::class => ['tags', 'posts']],
  morphTypeKey: 'tagType'
)]
public Film|Post $taggable,
public string $tagType

Changed

  • Replace all #[BindModelUsing('attribute')] to #[BindModel(using: 'attribute')] in your code (take in mind it must not be repeated under the same property)
  • Replace all #[BindModelWith(['relation1', 'relation2'])] to #[BindModel(with: ['relation1', 'relation2'])] in your code (take in mind it must not be repeated under the same property)

2.2.0

16 Oct 11:55
4882045
Compare
Choose a tag to compare

Added

  • OpenSoutheners\LaravelDto\Attributes\WithDefaultValue attribute to set default value
  • #[WithDefaultValue(Authenticatable::class)] will set as default value the authenticated user (Auth::user())

2.1.1

13 Oct 11:48
f71647b
Compare
Choose a tag to compare

Fixed

  • Now \stdClass properties get properly serialised as multidimensional arrays

2.1.0

13 Oct 10:29
3109ece
Compare
Choose a tag to compare

Added

  • TypeScript .d.ts generation command with --declarations option

Changed

  • Default TypeScript types generation command options now have some of them on the config file

Fixed

  • Config file now is exposed to be published using vendor:publish --provider="OpenSoutheners\\LaravelDto\\ServiceProvider" or vendor:publish --tag="config" commands
  • Non typed properties when nullable or not while TypeScript types generation

2.0.1

12 Oct 17:56
3764357
Compare
Choose a tag to compare

Fixed

  • Keys normalisation on types generator (snake case when enabled from config)
  • Types generator when empty collections

2.0.0

12 Oct 17:24
b0eb1f3
Compare
Choose a tag to compare

Added

  • Serialisation for DTO objects so now they can be sent to queued jobs
  • dto:typescript command for generating TypeScript types based on your application's DTOs

1.10.11

11 Oct 16:19
229b01a
Compare
Choose a tag to compare

Fixed

  • Sending multiple values (for e.g. 1,2,5) on a collection with BindModelUsing attribute or custom model's getRouteKeyName method now works querying all models
  • make:dto command now does not generate a ValidatedDataTransferObject with request static method on it

1.10.10

09 Oct 11:16
da403c6
Compare
Choose a tag to compare

Fixed

  • Request option for make:dto command when sent without a value fails

1.10.9

06 Oct 12:22
dc2232f
Compare
Choose a tag to compare

Fixed

  • make:dto with _id ending properties

1.10.8

06 Oct 12:11
1d2c532
Compare
Choose a tag to compare

Fixed

  • Fix make:dto command when validated form request sent with properties that has children items like array.*.item