Open zareismail opened 3 years ago
@zareismail Hi. You can pass a custom media resolver to mediaOnIndex
https://github.com/dmitrybubyakin/nova-medialibrary-field#mediaonindex
@zareismail Hi. You can pass a custom media resolver to
mediaOnIndex
https://github.com/dmitrybubyakin/nova-medialibrary-field#mediaonindex
Yeah. I know. But I think this default value is wrong and many developers will never notice it
@zareismail Does limit work with the eager loading?
@zareismail Does limit work with the eager loading?
I think, no. you can change it like this:
$resource->relationLoaded('media') || $resource->load(['media' => function($query) use ($limit) {
$query->limit();
});
return $resource->media->where('collection_name', $collectionName) ...
@zareismail Thank you. I'll think about that.
Hi. Thanks for the amazing package.
But there is a bug that causes the
N+1
query on the index view. The defaultmediaOnIndex
callback:Do not check the loaded media relationship. This causes
N+1
query on index view that can be changed like the below: