Skip to content

3.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 16 Oct 17:38
· 65 commits to main since this release
3c5f84c

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)