Basically, I have 2 models with the same is_published
boolean.
first model belongs to Many 2nd model and both has a scope isPublished
.
now, the relationships between them is like this:
public $hasManyThrough = [
'lessons_published' => [
Lesson::class,
'through' => Module::class,
'scope' => 'published'
],
];
when I try to access the relation lessons_published
from an instance of the 1st model Course, I have this sql error
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'is_published' in where clause is ambiguous (SQL:
anyone encoutnered this before?