Have a interesting problem. In the laravel app there are two models
Media.php. Media is attached to the Job via Spatie’s Laravel-MediaLibrary package. After making job and media models searchable with
toSearchableArray() they make their way to Algolia.
Presenting the results is happening via VueInstantSearch. If this were only handled on the server this line would call the media:
// php controller ...prep code $imageUrl = $job->getMedia('document')->first()->getUrl('thumbnail');
However, with algolia the controller is not fetching the job, so that code relationship is gone and useless for calling the job media path. I feel like I’m on the right track here:
// Vue.component <img src=“'/storage/'+ item.model_id + '/conversions/' + item.file_name” width=200 height=120 />
but this seems only for server, backend type search scenarios. I found this gist, but I’m not sure the relationship would be held (between Job and Media) that my search requires.
Do you have any ideas of how to accomplish this?