Add the `onlyDrafted` extension to the builder.

@param \Illuminate\Database\Eloquent\Builder $builder
@return void
341027
protected function addOnlyDrafted(Builder $builder): void
    {
        $builder->macro('onlyDrafted', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_drafted', 1);
        });
    }
1298815
public function update(Builder $builder, $value)
    {
        $this->behavior->update($builder->field, $value, $builder->id);
    }
1132261
protected function addOnlyArchived(Builder $builder): void
    {
        $builder->macro('onlyArchived', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNotNull('archived_at');
        });
    }
155252
protected function addOnlyTrashed(Builder $builder)
    {
        $builder->macro('onlyTrashed', function (Builder $builder) {
            $model = $builder->getModel();

            $builder->withoutGlobalScope($this)->whereNotNull(
                $model->getQualifiedDeletedAtColumn()
            );

            return $builder;
        });
    }
167179
protected function addOnlyNotApproved(Builder $builder): void
    {
        $builder->macro('onlyNotApproved', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNull('approved_at');
        });
    }
1001814
public function apply(Builder $builder, Model $model)
    {
        $columns = $model->getQualifiedOrderByColumns();

        foreach ($columns as $column => $direction) {

            $builder->orderBy($column, $direction);
        }

        $this->addUnordered($builder);
    }
145201
protected function addWithoutClosed(Builder $builder): void
    {
        $builder->macro('withoutClosed', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNull('closed_at');
        });
    }
477474
protected function addWithNotInvited(Builder $builder): void
    {
        $builder->macro('withNotInvited', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
36841
protected function addEnd(Builder $builder): void
    {
        $builder->macro('end', function (Builder $builder) {
            return $builder->update(['ended_at' => Date::now()]);
        });
    }
857472
protected function addOnlyNotAccepted(Builder $builder): void
    {
        $builder->macro('onlyNotAccepted', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->where('is_accepted', 0);
        });
    }
746595
public function apply(Builder $builder, Model $model): void
    {
        $builder->orderBy(self::NAME_ATTRIBUTE);
    }
831834
protected function addWithEnded(Builder $builder): void
    {
        $builder->macro('withEnded', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
191135
protected function addWithNotActivated(Builder $builder): void
    {
        $builder->macro('withNotActivated', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }
45957
protected function addOnlyNotAccepted(Builder $builder): void
    {
        $builder->macro('onlyNotAccepted', function (Builder $builder) {
            return $builder->withoutGlobalScope($this)->whereNull('accepted_at');
        });
    }
569456
protected function addKeep(Builder $builder): void
    {
        $builder->macro('keep', function (Builder $builder) {
            $builder->withNotKept();

            return $builder->update(['is_kept' => 1]);
        });
    }
1233364
protected function addApprove(Builder $builder): void
    {
        $builder->macro('approve', function (Builder $builder) {
            $builder->withNotApproved();

            return $builder->update(['is_approved' => 1]);
        });
    }
482304
protected function addWithExpired(Builder $builder): void
    {
        $builder->macro('withExpired', function (Builder $builder) {
            return $builder->withoutGlobalScope($this);
        });
    }