Replies: 1 comment
-
Hi @goellner I don't familiar with the package and I need more information the type of getMedia return type : MediaCollections\Models\Collections\MediaCollection
...
public function __construct(
...
public array $media
}
public function fromModel(ModelWithMedia $model)
{
return new self(){
...
media: $model->getMedia->toArray()
...
}
...
public function __construct(
...
public MediaCollection $media
...
}
public function fromModel(ModelWithMedia $model)
{
return new self{
...
media: $model->getMedia
...
}
}
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is anyone including media library items in their DTO and has an example for me how you set this up? When returning the content as JSON we need to include the media items in the response.
Beta Was this translation helpful? Give feedback.
All reactions