Add the with-postpone extension to the builder.

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

@return void
429655
protected function addWithPostponed(Builder $builder)
    {
        $builder->macro('withPostponed', function (Builder $builder) {
            $this->remove($builder, $builder->getModel());

            return $builder->whereIN($this->getStatusColumn($builder),
                [Status::APPROVED, Status::POSTPONED]);
        });
    }
1199168
protected function addWithTrashed(Builder $builder)
    {
        $builder->macro('withTrashed', function (Builder $builder, $withTrashed = true) {
            if (! $withTrashed) {
                return $builder->withoutTrashed();
            }

            return $builder->withoutGlobalScope($this);
        });
    }
831834
protected function addWithEnded(Builder $builder): void
    {
        $builder->macro('withEnded', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
917169
protected function addEnd(Builder $builder): void
    {
        $builder->macro('end', function (Builder $builder) {
            return $builder->update(['is_ended' => 1]);
        });
    }
720121
protected function addWithoutNotKept(Builder $builder): void
    {
        $builder->macro('withoutNotKept', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_kept', 1);
        });
    }
280939
protected function addApprove(Builder $builder): void
    {
        $builder->macro('approve', function (Builder $builder) {
            $builder->withNotApproved();

            return $builder->update(['approved_at' => Date::now()]);
        });
    }
499820
protected function addPending(Builder $builder)
    {
        $builder->macro('pending', function (Builder $builder) {
            $model = $builder->getModel();

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

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

            return $builder;
        });
    }
1124955
protected function addWithoutNotPublished(Builder $builder): void
    {
        $builder->macro('withoutNotPublished', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNotNull('published_at');
        });
    }
1338302
protected function addUndoApprove(Builder $builder): void
    {
        $builder->macro('undoApprove', function (Builder $builder) {
            return $builder->update(['is_approved' => 0]);
        });
    }
1233364
protected function addApprove(Builder $builder): void
    {
        $builder->macro('approve', function (Builder $builder) {
            $builder->withNotApproved();

            return $builder->update(['is_approved' => 1]);
        });
    }
1087295
protected function addWithoutArchived(Builder $builder): void
    {
        $builder->macro('withoutArchived', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNull('archived_at');
        });
    }
534852
protected function addVerify(Builder $builder): void
    {
        $builder->macro('verify', function (Builder $builder) {
            $builder->withNotVerified();

            return $builder->update(['is_verified' => 1]);
        });
    }
42516
protected function addApprove(Builder $builder)
    {
        $builder->macro('approve', function (Builder $builder, $id = null) {
            $builder->withAnyStatus();
            return $this->updateModerationStatus($builder, $id, Status::APPROVED);
        });
    }
631620
protected function addWithNotApproved(Builder $builder): void
    {
        $builder->macro('withNotApproved', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
291033
public function extend(Builder $builder): void
    {
        foreach ($this->extensions as $extension) {
            $this->{"add{$extension}"}($builder);
        }
    }
446854
protected function addWithoutNotInvited(Builder $builder): void
    {
        $builder->macro('withoutNotInvited', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNotNull('invited_at');
        });
    }
338151
protected function addWithoutExpired(Builder $builder): void
    {
        $builder->macro('withoutExpired', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_expired', 0);
        });
    }