class PublishedScope implements Scope (View source)

Properties

protected array $extensions All of the extensions to be added to the builder.

Methods

void
apply(Builder $builder, Model $model)

Apply the scope to a given Eloquent query builder.

void
extend(Builder $builder)

Extend the query builder with the needed functions.

void
addWithDrafts(Builder $builder)

Add the with-drafts extension to the builder.

void
addOnlyPublished(Builder $builder)

Add the only-published extension to the builder.

void
addOnlyDrafts(Builder $builder)

Add the only-drafts extension to the builder.

Details

void apply(Builder $builder, Model $model)

Apply the scope to a given Eloquent query builder.

Parameters

Builder $builder
Model $model

Return Value

void

void extend(Builder $builder)

Extend the query builder with the needed functions.

Parameters

Builder $builder

Return Value

void

protected void addWithDrafts(Builder $builder)

Add the with-drafts extension to the builder.

Parameters

Builder $builder

Return Value

void

protected void addOnlyPublished(Builder $builder)

Add the only-published extension to the builder.

Parameters

Builder $builder

Return Value

void

protected void addOnlyDrafts(Builder $builder)

Add the only-drafts extension to the builder.

Parameters

Builder $builder

Return Value

void