i have 3 tables
- shops
- packages
- shop_packages
as below
Shops
Packages
i am using following relationship in Shop Model
public function packages(){
return $this->belongsToMany(Package::class,'shop_packages','shop_id','package_id');
}
and below in Package Model
public function shop(){
return $this->belongsToMany(Shop::class,'shop_packages','package_id','shop_id');
}
when i try to get
Package::with('shop')->get();
it returns me packages but shops remain empty can someone please guide me how can i fix this


