I am trying to eager load all the logotype urls from Spatie's laravel-medialibrary:
They are then going to used a json-response.
Ideally I the library would work as follow:
# Get all clients with url to logotype (small)`
Client::with('media.logotype', function ($q) {
$q->where('mediaConversion', 'small')->getUrl();
})->get()
# Get all clients with all urls for media:logotype
Client::with('media.logotype', function ($q) {
$q->getUrl();
})->get()
Ideas?