responsiv / uploader-plugin

Collection of File Upload components for October
MIT License
62 stars 39 forks source link

Retrieving deffered uploaded images #48

Closed amjadniazi48 closed 6 years ago

amjadniazi48 commented 6 years ago

i have uploaded multiple images with deffered binding and save them using this method $project->save(null, post('_session_key')); they are saved and i can see them on backend but when i try to retrieve them using sitesearch plugin everything in database model is retrieving but cannot get the images , following is my relation $attachMany=[ 'postingimage'=>['System\Models\File', 'order' => 'sort_order'] ]; follwing is the code in sitesearch plugin for retrieving


if ($item->postingimage) {

                    return [
                        'title' => $item->title,
                        'text' => $item->description,
                        'text' => $item->price,
                        'text' => $item->brandname,
                        'text' => $item->name,
                          'thumb'     => $item->postingimage->first(),
                        'relevance' => $relevance, // higher relevance results in a higher
                        'model' => $item, 
                    ];
}

but when i print this model i got the following result

{"title":"gdsag","brandname":"Yamaha","description":"gdsga","price":5887,"name":"Rawalpindi",
"postingimage":[]}

everthing is there except images Raise this issue on sitesearch plugin as well https://github.com/OFFLINE-GmbH/oc-site-search-plugin/issues/56