@sinnbeck sir have read this https://laravel.com/api/5.2/Illuminate/Database/Query/JoinClause.html
Feb 18, 2020
8
Level 102
Scopes in join
Does anyone know of any way to allow the usage of scopes in join clauses? Perhaps a package.
Using it just throws and error.
Call to undefined method Illuminate\Database\Query\JoinClause::active()
Level 35
Not really what you are looking for probably but can't you "solve" this with a work around to combine your join + where clause into a separate scope? Like this:
public function scopeJoinActiveGroups($query)
{
$query->join(/* */);
$query->where($this->getTable() . '.type', '>', 1);
}
Project::joinActiveGroups()->get();
Please or to participate in this conversation.