public function scopeVendorOf($query, Enterprise $customer)
{
return $query->whereHas('customers', function ($query) use ($customer) {
$query->where('id', $customer->id);
});
}
now if I call this scope before the search scope it works, but calling the search scope before the vendorOf() one will fail.
I have a scope which is created using whereHas :
now if I call this scope before the search scope it works, but calling the search scope before the vendorOf() one will fail.