interface SoftDeletingMacros

Declare the builder macros that SoftDeletingScope adds, for static analysis.

Keep these signatures in step with the scope's macros.

Methods

withTrashed(bool $withTrashed = true)

Include soft-deleted models in the results, or exclude them when false.

withoutTrashed()

Exclude soft-deleted models from the results.

onlyTrashed()

Only include soft-deleted models in the results.

int
restore()

Restore the matching soft-deleted models.

restoreOrCreate(array $attributes = [], array $values = [])

Get the first matching model or create it, then restore it.

createOrRestore(array $attributes = [], array $values = [])

Create the model or get the matching one, then restore it.

Details

at line 21
SoftDeletingMacros withTrashed(bool $withTrashed = true)

Include soft-deleted models in the results, or exclude them when false.

Parameters

bool $withTrashed

Return Value

SoftDeletingMacros

at line 26
SoftDeletingMacros withoutTrashed()

Exclude soft-deleted models from the results.

Return Value

SoftDeletingMacros

at line 31
SoftDeletingMacros onlyTrashed()

Only include soft-deleted models in the results.

Return Value

SoftDeletingMacros

at line 36
int restore()

Restore the matching soft-deleted models.

Return Value

int

at line 45
Model restoreOrCreate(array $attributes = [], array $values = [])

Get the first matching model or create it, then restore it.

Parameters

array $attributes
array $values

Return Value

Model

at line 54
Model createOrRestore(array $attributes = [], array $values = [])

Create the model or get the matching one, then restore it.

Parameters

array $attributes
array $values

Return Value

Model