trait SoftDeletes (View source)

Properties

protected bool $forceDeleting

Indicates if the model is currently force deleting.

Methods

static void
bootSoftDeletes()

Boot the soft deleting trait for a model.

void
initializeSoftDeletes()

Initialize the soft deleting trait for an instance.

bool|null
forceDelete()

Force a hard delete on a soft deleted model.

mixed
performDeleteOnModel()

Perform the actual delete query on this model instance.

void
runSoftDelete()

Perform the actual delete query on this model instance.

bool|null
restore()

Restore a soft-deleted model instance.

bool
trashed()

Determine if the model instance has been soft-deleted.

static void
restoring(Closure|string $callback)

Register a restoring model event with the dispatcher.

static void
restored(Closure|string $callback)

Register a restored model event with the dispatcher.

bool
isForceDeleting()

Determine if the model is currently force deleting.

string
getDeletedAtColumn()

Get the name of the "deleted at" column.

string
getQualifiedDeletedAtColumn()

Get the fully qualified "deleted at" column.

static Builder
withTrashed()

No description

static Builder
onlyTrashed()

No description

static Builder
withoutTrashed()

No description

Details

static void bootSoftDeletes()

Boot the soft deleting trait for a model.

Return Value

void

void initializeSoftDeletes()

Initialize the soft deleting trait for an instance.

Return Value

void

bool|null forceDelete()

Force a hard delete on a soft deleted model.

Return Value

bool|null

protected mixed performDeleteOnModel()

Perform the actual delete query on this model instance.

Return Value

mixed

protected void runSoftDelete()

Perform the actual delete query on this model instance.

Return Value

void

bool|null restore()

Restore a soft-deleted model instance.

Return Value

bool|null

bool trashed()

Determine if the model instance has been soft-deleted.

Return Value

bool

static void restoring(Closure|string $callback)

Register a restoring model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

static void restored(Closure|string $callback)

Register a restored model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

bool isForceDeleting()

Determine if the model is currently force deleting.

Return Value

bool

string getDeletedAtColumn()

Get the name of the "deleted at" column.

Return Value

string

string getQualifiedDeletedAtColumn()

Get the fully qualified "deleted at" column.

Return Value

string

static Builder withTrashed()

No description

Return Value

Builder

static Builder onlyTrashed()

No description

Return Value

Builder

static Builder withoutTrashed()

No description

Return Value

Builder