SoftDeletingScope

class SoftDeletingScope implements ScopeInterface (View source)

Properties

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

Methods

void apply(Builder $builder)

Apply the scope to a given Eloquent query builder.

void remove(Builder $builder)

Remove the scope from the given Eloquent query builder.

void extend(Builder $builder)

Extend the query builder with the needed functions.

string getDeletedAtColumn(Builder $builder)

Get the "deleted at" column for the builder.

void addForceDelete(Builder $builder)

Add the force delete extension to the builder.

void addRestore(Builder $builder)

Add the restore extension to the builder.

void addWithTrashed(Builder $builder)

Add the with-trashed extension to the builder.

void addOnlyTrashed(Builder $builder)

Add the only-trashed extension to the builder.

bool isSoftDeleteConstraint(array $where, string $column)

Determine if the given where clause is a soft delete constraint.

Details

void apply(Builder $builder)

Apply the scope to a given Eloquent query builder.

Parameters

Builder $builder

Return Value

void

void remove(Builder $builder)

Remove the scope from the given Eloquent query builder.

Parameters

Builder $builder

Return Value

void

void extend(Builder $builder)

Extend the query builder with the needed functions.

Parameters

Builder $builder

Return Value

void

protected string getDeletedAtColumn(Builder $builder)

Get the "deleted at" column for the builder.

Parameters

Builder $builder

Return Value

string

protected void addForceDelete(Builder $builder)

Add the force delete extension to the builder.

Parameters

Builder $builder

Return Value

void

protected void addRestore(Builder $builder)

Add the restore extension to the builder.

Parameters

Builder $builder

Return Value

void

protected void addWithTrashed(Builder $builder)

Add the with-trashed extension to the builder.

Parameters

Builder $builder

Return Value

void

protected void addOnlyTrashed(Builder $builder)

Add the only-trashed extension to the builder.

Parameters

Builder $builder

Return Value

void

protected bool isSoftDeleteConstraint(array $where, string $column)

Determine if the given where clause is a soft delete constraint.

Parameters

array $where
string $column

Return Value

bool

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Database/Eloquent/SoftDeletingScope.html