This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

deroccha
deroccha

I use the following query in my component to get shop data with banner details, and I try to get the attached images to banners but I don't know how should I proceed

 $shop_id = $this->param('id');
    $banners = Shop::with('banners')  
         //->with('img') this one fails
         ->where('tracker_shops.id', $shop_id)          
        ->get();

in my model shop banner is related as it follows public $hasMany = [

    'banners' => ['Test\TdTracker\Models\Banner'],

];

now in my banner model I attach to each banner an image like this public $attachOne = [

    'img' => ['System\Models\File']

];

Last updated

deroccha
deroccha

I got this one using scope

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.