Local scopes allow you to define common sets of constraints that you may easily re-use throughout your application.
public function scopePopular($query)
{
return $query->where('votes', '>', 100);
}
Consider:
$users = App\User::popular()->active()->orderBy('created_at')->get();