SoftDeletes
Table of Contents
- $forceDeleting : bool
- Indicates if the model is currently force deleting.
- bootSoftDeletes() : void
- Boot the soft deleting trait for a model.
- forceDelete() : bool|null
- Force a hard delete on a soft deleted model.
- getDeletedAtColumn() : string
- Get the name of the "deleted at" column.
- getQualifiedDeletedAtColumn() : string
- Get the fully qualified "deleted at" column.
- isForceDeleting() : bool
- Determine if the model is currently force deleting.
- restore() : bool|null
- Restore a soft-deleted model instance.
- restored() : void
- Register a restored model event with the dispatcher.
- restoring() : void
- Register a restoring model event with the dispatcher.
- trashed() : bool
- Determine if the model instance has been soft-deleted.
- performDeleteOnModel() : mixed
- Perform the actual delete query on this model instance.
- runSoftDelete() : void
- Perform the actual delete query on this model instance.
Properties
$forceDeleting
Indicates if the model is currently force deleting.
protected
bool
$forceDeleting
= false
Methods
bootSoftDeletes()
Boot the soft deleting trait for a model.
public
static bootSoftDeletes() : void
Return values
void —forceDelete()
Force a hard delete on a soft deleted model.
public
forceDelete() : bool|null
Return values
bool|null —getDeletedAtColumn()
Get the name of the "deleted at" column.
public
getDeletedAtColumn() : string
Return values
string —getQualifiedDeletedAtColumn()
Get the fully qualified "deleted at" column.
public
getQualifiedDeletedAtColumn() : string
Return values
string —isForceDeleting()
Determine if the model is currently force deleting.
public
isForceDeleting() : bool
Return values
bool —restore()
Restore a soft-deleted model instance.
public
restore() : bool|null
Return values
bool|null —restored()
Register a restored model event with the dispatcher.
public
static restored(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —restoring()
Register a restoring model event with the dispatcher.
public
static restoring(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —trashed()
Determine if the model instance has been soft-deleted.
public
trashed() : bool
Return values
bool —performDeleteOnModel()
Perform the actual delete query on this model instance.
protected
performDeleteOnModel() : mixed
Return values
mixed —runSoftDelete()
Perform the actual delete query on this model instance.
protected
runSoftDelete() : void