Add the with-pending extension to the builder.

@param  \Illuminate\Database\Eloquent\Builder $builder

@return void
193982
protected function addWithPending(Builder $builder)
    {
        $builder->macro('withPending', function (Builder $builder) {
            $this->remove($builder, $builder->getModel());

            return $builder->whereIN($this->getStatusColumn($builder), [Status::APPROVED, Status::PENDING]);
        });
    }
316555
protected function addOnlyClosed(Builder $builder): void
    {
        $builder->macro('onlyClosed', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNotNull('closed_at');
        });
    }
660950
protected function addPend(Builder $builder)
    {
        $builder->macro('pend', function (Builder $builder, $id = null) {
            $builder->withAnyStatus();
            return $this->updateModerationStatus($builder, $id, Status::PENDING);
        });
    }
1037684
protected function addWithoutNotApproved(Builder $builder): void
    {
        $builder->macro('withoutNotApproved', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_approved', 1);
        });
    }
63194
protected function addArchive(Builder $builder): void
    {
        $builder->macro('archive', function (Builder $builder) {
            return $builder->update(['archived_at' => Date::now()]);
        });
    }
831834
protected function addWithEnded(Builder $builder): void
    {
        $builder->macro('withEnded', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
1365318
protected function addUndoEnd(Builder $builder): void
    {
        $builder->macro('undoEnd', function (Builder $builder) {
            $builder->withEnded();

            return $builder->update(['ended_at' => null]);
        });
    }
1289328
protected function addWithNotVerified(Builder $builder): void
    {
        $builder->macro('withNotVerified', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
849239
protected function addInvite(Builder $builder): void
    {
        $builder->macro('invite', function (Builder $builder) {
            $builder->withNotInvited();

            return $builder->update(['invited_at' => Date::now()]);
        });
    }
42516
protected function addApprove(Builder $builder)
    {
        $builder->macro('approve', function (Builder $builder, $id = null) {
            $builder->withAnyStatus();
            return $this->updateModerationStatus($builder, $id, Status::APPROVED);
        });
    }
1338302
protected function addUndoApprove(Builder $builder): void
    {
        $builder->macro('undoApprove', function (Builder $builder) {
            return $builder->update(['is_approved' => 0]);
        });
    }
241929
protected function addPostpone(Builder $builder)
    {
        $builder->macro('postpone', function (Builder $builder, $id = null) {
            $builder->withAnyStatus();
            return $this->updateModerationStatus($builder, $id, Status::POSTPONED);
        });
    }
152155
protected function addReject(Builder $builder)
    {
        $builder->macro('reject', function (Builder $builder, $id = null) {
            $builder->withAnyStatus();
            return $this->updateModerationStatus($builder, $id, Status::REJECTED);

        });
    }
359861
protected function addOnlyEnded(Builder $builder): void
    {
        $builder->macro('onlyEnded', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_ended', 1);
        });
    }
1088873
protected function addExpire(Builder $builder): void
    {
        $builder->macro('expire', function (Builder $builder) {
            return $builder->update(['expired_at' => Date::now()]);
        });
    }
534852
protected function addVerify(Builder $builder): void
    {
        $builder->macro('verify', function (Builder $builder) {
            $builder->withNotVerified();

            return $builder->update(['is_verified' => 1]);
        });
    }
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;
        });
    }