Closed sjbronner closed 6 years ago
Hi @sjbronner, can you also provide the Eloquent queries that go along with these SQL queries? I would like to recreate a test in the same way your Queries are constructed. Thanks!
Scope in Event Model:
public function scopeHasMusician(Builder $query) : Builder
{
return $query->has('musicians');
}
Relationship of Event Model:
public function musicians() : BelongsToMany
{
return $this->belongsToMany(Contact::class, 'event_musician');
}
@sjbronner This is an issue with scopeWhereInIfNotNull()
returning the incorrect type of Builder.
Issue
Certain queries receive incorrect results. We were guessing it might have to do with inner joins. Here are two queries from the ceed project:
Environment
Laravel Version: v5.5.39 Laravel Model Caching Package Version: 0.2.51 PHP Version: 7.2.3 Operating System & Version: Archlinux