Closed
Description
As described in detail here:
http://stackoverflow.com/questions/36856090/counting-models-related-through-manytomany-only-if-a-pivot-attribute-null-lara
The wherePivot
would not accept '!='
operator.
This code produces a collection:
`public function activities()
{
return $this->belongsToMany('App\Models\Activity')->withPivot('done_at')->wherePivot('done_at','=',null);
}`
while this
`public function activitiesOnlyDone()
{
return $this->belongsToMany('App\Models\Activity')->withPivot('done_at')->wherePivot('done_at','!=',null);
}`
throws Illegal operator
error.
Metadata
Metadata
Assignees
Labels
No labels