Releases: open-southeners/laravel-dto
Releases · open-southeners/laravel-dto
2.2.1
3.0.0
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
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
Fixed
- Now
\stdClass
properties get properly serialised as multidimensional arrays
2.1.0
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"
orvendor:publish --tag="config"
commands - Non typed properties when nullable or not while TypeScript types generation
2.0.1
Fixed
- Keys normalisation on types generator (snake case when enabled from config)
- Types generator when empty collections
2.0.0
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
Fixed
- Sending multiple values (for e.g. 1,2,5) on a collection with
BindModelUsing
attribute or custom model'sgetRouteKeyName
method now works querying all models make:dto
command now does not generate aValidatedDataTransferObject
with request static method on it
1.10.10
Fixed
- Request option for
make:dto
command when sent without a value fails
1.10.9
Fixed
make:dto
with_id
ending properties