trait SoftDeletes (View source)

Methods

static  void
bootSoftDeletes()

Boot the soft deleting trait for a model.

bool|null
forceDelete()

Force a hard delete on a soft deleted model.

bool|null
restore()

Restore a soft-deleted model instance.

bool
trashed()

Determine if the model instance has been soft-deleted.

static  Builder|SoftDeletes
withTrashed()

Get a new query builder that includes soft deletes.

static  Builder|SoftDeletes
onlyTrashed()

Get a new query builder that only includes soft deletes.

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.

string
getDeletedAtColumn()

Get the name of the "deleted at" column.

string
getQualifiedDeletedAtColumn()

Get the fully qualified "deleted at" column.

Details

at line line 19
static void bootSoftDeletes()

Boot the soft deleting trait for a model.

Return Value

void

at line line 29
bool|null forceDelete()

Force a hard delete on a soft deleted model.

Return Value

bool|null

at line line 73
bool|null restore()

Restore a soft-deleted model instance.

Return Value

bool|null

at line line 101
bool trashed()

Determine if the model instance has been soft-deleted.

Return Value

bool

at line line 111
static Builder|SoftDeletes withTrashed()

Get a new query builder that includes soft deletes.

Return Value

Builder|SoftDeletes

at line line 121
static Builder|SoftDeletes onlyTrashed()

Get a new query builder that only includes soft deletes.

Return Value

Builder|SoftDeletes

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

Register a restoring model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

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

Register a restored model event with the dispatcher.

Parameters

Closure|string $callback

Return Value

void

at line line 157
string getDeletedAtColumn()

Get the name of the "deleted at" column.

Return Value

string

at line line 167
string getQualifiedDeletedAtColumn()

Get the fully qualified "deleted at" column.

Return Value

string