$builder) { // applied to all queries $builder->whereNull('done_at'); } public function extend(Builder $builder, Model $model) { $builder->macro('done', function (Builder $builder) { return $builder->withoutGlobalScope($this) ->whereNotNull('done_at'); }); } } // retrieving done list $todos = Task::done()->get();