trait Illuminate / Database / Eloquent / SoftDeletes
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.

SoftDeletes

Properties

protected

$forceDeleting bool

Indicates if the model is currently force deleting.

Default: false

Methods

public static

bootSoftDeletes ( ) : void

Boot the soft deleting trait for a model.

public

initializeSoftDeletes ( ) : void

Initialize the soft deleting trait for an instance.

public

forceDelete ( ) : bool|null

Force a hard delete on a soft deleted model.

public

forceDeleteQuietly ( ) : bool|null

Force a hard delete on a soft deleted model without raising any events.

protected

performDeleteOnModel ( ) : mixed

Perform the actual delete query on this model instance.

protected

runSoftDelete ( ) : void

Perform the actual delete query on this model instance.

public

restore ( ) : bool

Restore a soft-deleted model instance.

public

restoreQuietly ( ) : bool

Restore a soft-deleted model instance without raising any events.

public

trashed ( ) : bool

Determine if the model instance has been soft-deleted.

public static

softDeleted ( $callback ) : void

Register a "softDeleted" model event callback with the dispatcher.

Parameters

public static

restoring ( $callback ) : void

Register a "restoring" model event callback with the dispatcher.

Parameters

public static

restored ( $callback ) : void

Register a "restored" model event callback with the dispatcher.

Parameters

public static

forceDeleting ( $callback ) : void

Register a "forceDeleting" model event callback with the dispatcher.

Parameters

public static

forceDeleted ( $callback ) : void

Register a "forceDeleted" model event callback with the dispatcher.

Parameters

public

isForceDeleting ( ) : bool

Determine if the model is currently force deleting.

public

getDeletedAtColumn ( ) : string

Get the name of the "deleted at" column.

public

getQualifiedDeletedAtColumn ( ) : string

Get the fully qualified "deleted at" column.