SoftDeletingScope
in package
implements
Scope
Interfaces, Classes and Traits
Table of Contents
- $extensions : array<string|int, mixed>
- All of the extensions to be added to the builder.
- apply() : void
- Apply the scope to a given Eloquent query builder.
- extend() : void
- Extend the query builder with the needed functions.
- addOnlyTrashed() : void
- Add the only-trashed extension to the builder.
- addRestore() : void
- Add the restore extension to the builder.
- addWithoutTrashed() : void
- Add the without-trashed extension to the builder.
- addWithTrashed() : void
- Add the with-trashed extension to the builder.
- getDeletedAtColumn() : string
- Get the "deleted at" column for the builder.
Properties
$extensions
All of the extensions to be added to the builder.
protected
array<string|int, mixed>
$extensions
= ['Restore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed']
Methods
apply()
Apply the scope to a given Eloquent query builder.
public
apply(Builder $builder, Model $model) : void
Parameters
Return values
void —extend()
Extend the query builder with the needed functions.
public
extend(Builder $builder) : void
Parameters
- $builder : Builder
Return values
void —addOnlyTrashed()
Add the only-trashed extension to the builder.
protected
addOnlyTrashed(Builder $builder) : void
Parameters
- $builder : Builder
Return values
void —addRestore()
Add the restore extension to the builder.
protected
addRestore(Builder $builder) : void
Parameters
- $builder : Builder
Return values
void —addWithoutTrashed()
Add the without-trashed extension to the builder.
protected
addWithoutTrashed(Builder $builder) : void
Parameters
- $builder : Builder
Return values
void —addWithTrashed()
Add the with-trashed extension to the builder.
protected
addWithTrashed(Builder $builder) : void
Parameters
- $builder : Builder
Return values
void —getDeletedAtColumn()
Get the "deleted at" column for the builder.
protected
getDeletedAtColumn(Builder $builder) : string
Parameters
- $builder : Builder