I have product Model which belongs to Shop Model. Shop Can be Active or in Active, So I need to get products from active shops only. So I added this method
public function isActiveShop(){
return $this->where($this->shop->status,'active');
}
and from my controller
$prodcuts = Product::where('id',$rawArray)->isActiveShop()->get();
And I get this error
"Call to undefined method Illuminate\Database\Query\Builder::isActiveShop()"