Add the `onlyEnded` extension to the builder.

@param \Illuminate\Database\Eloquent\Builder $builder
@return void
341414
protected function addOnlyEnded(Builder $builder): void
    {
        $builder->macro('onlyEnded', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNotNull('ended_at');
        });
    }
1243896
protected function addOnlyBanned(Builder $builder): void
    {
        $builder->macro('onlyBanned', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNotNull('banned_at');
        });
    }
1338302
protected function addUndoApprove(Builder $builder): void
    {
        $builder->macro('undoApprove', function (Builder $builder) {
            return $builder->update(['is_approved' => 0]);
        });
    }
1148431
protected function addRejected(Builder $builder)
    {
        $builder->macro('rejected', function (Builder $builder) {
            $model = $builder->getModel();

            $this->remove($builder, $model);

            $builder->where($model->getQualifiedStatusColumn(), '=', Status::REJECTED);

            return $builder;
        });
    }
1120178
protected function addOnlyNotApproved(Builder $builder): void
    {
        $builder->macro('onlyNotApproved', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_approved', 0);
        });
    }
1308337
protected function addOnlyNotKept(Builder $builder): void
    {
        $builder->macro('onlyNotKept', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_kept', 0);
        });
    }
339242
public function apply(Builder $builder)
    {
        $model = $builder->getModel();

        $builder->whereNull($model->getQualifiedDeletedAtColumn());

        $this->extend($builder);
    }
23062
protected function addOnlyNotInvited(Builder $builder): void
    {
        $builder->macro('onlyNotInvited', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_invited', 0);
        });
    }
338151
protected function addWithoutExpired(Builder $builder): void
    {
        $builder->macro('withoutExpired', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_expired', 0);
        });
    }
183767
protected function addWithNotAccepted(Builder $builder): void
    {
        $builder->macro('withNotAccepted', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
143107
protected function addOnlyExpired(Builder $builder): void
    {
        $builder->macro('onlyExpired', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_expired', 1);
        });
    }
413393
protected function addOnlyNotPublished(Builder $builder): void
    {
        $builder->macro('onlyNotPublished', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNull('published_at');
        });
    }
802538
protected function addUndoInvite(Builder $builder): void
    {
        $builder->macro('undoInvite', function (Builder $builder) {
            return $builder->update(['is_invited' => 0]);
        });
    }
849239
protected function addInvite(Builder $builder): void
    {
        $builder->macro('invite', function (Builder $builder) {
            $builder->withNotInvited();

            return $builder->update(['invited_at' => Date::now()]);
        });
    }
831834
protected function addWithEnded(Builder $builder): void
    {
        $builder->macro('withEnded', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
1233364
protected function addApprove(Builder $builder): void
    {
        $builder->macro('approve', function (Builder $builder) {
            $builder->withNotApproved();

            return $builder->update(['is_approved' => 1]);
        });
    }
77179
protected function addWithoutDrafted(Builder $builder): void
    {
        $builder->macro('withoutDrafted', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_drafted', 0);
        });
    }