Hi there
My content thumbnail is not appearing in search result for some reason, it doesn't return any error, it only displays the image not loaded icon instead of the thumbnail in frontend, i can give you any information you need to help me identify the problem and i will be truly greatful if you do so
Plugin.php:
\Event::listen('offline.sitesearch.query', function ($query){
$items = Models\Category::where('category_title', 'like', "%${query}%")
->get();
$results = $items->map(function ($item) use ($query){
$relevance = mb_stripos($item->title, $query) !== false ? 2 : 1;
return [
'title' => $item->category_title,
'url' => 'categories/' . $item->slug,
'thumb' => optional($item->categoryimage)->first(),
'relevance' => $relevance
];
});
return [
'provider' => 'category',
'results' => $results,
];
});
Models/Category.php
public $attachOne = [
'categoryimage' => 'System\Models\File'
];