Here is a copy of a scope that I have:
In my model:
public function scopeIsFeatured($query)
{
return $query->where('is_featured', '=', 1);
}
In my controller:
$pages = Content::InPrint()->IsFeatured()->orderBy('order')->get();
You should be able to chain your scope like you did but I have a feeling that the issue might be in your controller call.
Also, you might want to consider breaking up your big scope into smaller ones and just chain them like I did in my controller call.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community