trait SoftDeletes

Properties

protected bool $forceDeleting Indicates if the model is currently force deleting.

Methods

static 
bootSoftDeletes()

No description

static 
withTrashed($withTrashed = true)

No description

static 
onlyTrashed()

No description

static 
withoutTrashed()

No description

static 
makeQueryBuilder($appends = [])

No description

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 callback with the dispatcher.

static void
restored(Closure|string $callback)

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

static void
forceDeleted(Closure|string $callback)

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

bool
isForceDeleting()

Determine if the model is currently force deleting.

string
getDeletedAtColumn()

Get the name of the "deleted at" column.

Details

at line 22
static bootSoftDeletes()

at line 29
static protected withTrashed($withTrashed = true)

Parameters

$withTrashed

at line 35
static protected onlyTrashed()

at line 41
static protected withoutTrashed()

at line 47
static protected makeQueryBuilder($appends = [])

Parameters

$appends

at line 102
void initializeSoftDeletes()

Initialize the soft deleting trait for an instance.

Return Value

void

at line 116
bool|null forceDelete()

Force a hard delete on a soft deleted model.

Return Value

bool|null

at line 136
protected mixed performDeleteOnModel()

Perform the actual delete query on this model instance.

Return Value

mixed

at line 154
protected void runSoftDelete()

Perform the actual delete query on this model instance.

Return Value

void

at line 167
bool|null restore()

Restore a soft-deleted model instance.

Return Value

bool|null

at line 201
bool trashed()

Determine if the model instance has been soft-deleted.

Return Value

bool

at line 213
static void restoring(Closure|string $callback)

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

Parameters

Closure|string $callback

Return Value

void

at line 224
static void restored(Closure|string $callback)

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

Parameters

Closure|string $callback

Return Value

void

at line 235
static void forceDeleted(Closure|string $callback)

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

Parameters

Closure|string $callback

Return Value

void

at line 245
bool isForceDeleting()

Determine if the model is currently force deleting.

Return Value

bool

at line 256
string getDeletedAtColumn()

Get the name of the "deleted at" column.

Return Value

string