Closed dpetrovaliev closed 4 years ago
The query contains multiple id
columns and the database doesn't know which one you are referring to.
You need to provide the table name:
public function isPartOfVenue(Venue $venue)
{
return $this->venues()->where('venues.id', $venue->id)->exists();
}
Is there a way when you know type of relation and related object(in my case 'venues') to append table name to all where params ?
You could implement such a solution, but it wouldn't be a one-liner. IMO, it's much easier to provide the table name yourself.
Hi, i was really impressed by this package until i had to perform a where query on hasManyDeep relation.
here is my tables:
User -id -name ...
Company -id -name ...
Users_Companies -company_id -user_id
Venues -id -name -company_id ...
My User model has this relation:
When i run this query:
I'm receiving an error: