trait SoftDeletes

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.

int|bool|null
forceDelete()

Force a hard delete on a soft deleted model.

int|bool|null
forceDeleteQuietly()

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

static int
forceDestroy(Collection|Collection|array|int|string $ids)

Destroy the models for the given IDs.

void
performDeleteOnModel()

Perform the actual delete query on this model instance.

void
runSoftDelete()

Perform the actual delete query on this model instance.

bool
restore()

Restore a soft-deleted model instance.

bool
restoreQuietly()

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

bool
trashed()

Determine if the model instance has been soft-deleted.

static void
softDeleted(QueuedClosure|callable|string $callback)

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

static void
restoring(QueuedClosure|callable|string $callback)

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

static void
restored(QueuedClosure|callable|string $callback)

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

static void
forceDeleting(QueuedClosure|callable|string $callback)

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

static void
forceDeleted(QueuedClosure|callable|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.

string
getQualifiedDeletedAtColumn()

Get the fully-qualified "deleted at" column.

void
static()

\Hypervel\Database\Eloquent\Builder withoutTrashed()

static static
restoreOrCreate(array<string $, mixed> $attributes = '[]', mixed> $values = '[]')

No description

static static
createOrRestore(array<string $, mixed> $attributes = '[]', mixed> $values = '[]')

No description

Details

at line 28
static void bootSoftDeletes()

Boot the soft deleting trait for a model.

Return Value

void

at line 36
void initializeSoftDeletes()

Initialize the soft deleting trait for an instance.

Return Value

void

at line 48
int|bool|null forceDelete()

Force a hard delete on a soft deleted model.

Return Value

int|bool|null

at line 73
int|bool|null forceDeleteQuietly()

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

Return Value

int|bool|null

at line 81
static int forceDestroy(Collection|Collection|array|int|string $ids)

Destroy the models for the given IDs.

Parameters

Collection|Collection|array|int|string $ids

Return Value

int

at line 117
protected void performDeleteOnModel()

Perform the actual delete query on this model instance.

Return Value

void

at line 133
protected void runSoftDelete()

Perform the actual delete query on this model instance.

Return Value

void

at line 159
bool restore()

Restore a soft-deleted model instance.

Return Value

bool

at line 187
bool restoreQuietly()

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

Return Value

bool

at line 197
bool trashed()

Determine if the model instance has been soft-deleted.

Return Value

bool

Exceptions

MissingAttributeException

at line 217
static void softDeleted(QueuedClosure|callable|string $callback)

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

Listener persists on the worker-wide event dispatcher for the worker lifetime; runtime use leaks listeners across every subsequent request.

Parameters

QueuedClosure|callable|string $callback

Return Value

void

at line 229
static void restoring(QueuedClosure|callable|string $callback)

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

Listener persists on the worker-wide event dispatcher for the worker lifetime; runtime use leaks listeners across every subsequent request.

Parameters

QueuedClosure|callable|string $callback

Return Value

void

at line 241
static void restored(QueuedClosure|callable|string $callback)

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

Listener persists on the worker-wide event dispatcher for the worker lifetime; runtime use leaks listeners across every subsequent request.

Parameters

QueuedClosure|callable|string $callback

Return Value

void

at line 253
static void forceDeleting(QueuedClosure|callable|string $callback)

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

Listener persists on the worker-wide event dispatcher for the worker lifetime; runtime use leaks listeners across every subsequent request.

Parameters

QueuedClosure|callable|string $callback

Return Value

void

at line 265
static void forceDeleted(QueuedClosure|callable|string $callback)

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

Listener persists on the worker-wide event dispatcher for the worker lifetime; runtime use leaks listeners across every subsequent request.

Parameters

QueuedClosure|callable|string $callback

Return Value

void

at line 274
bool isForceDeleting()

Determine if the model is currently force deleting.

Return Value

bool

at line 282
string getDeletedAtColumn()

Get the name of the "deleted at" column.

Return Value

string

at line 290
string getQualifiedDeletedAtColumn()

Get the fully-qualified "deleted at" column.

Return Value

string

at line 18
void static()

\Hypervel\Database\Eloquent\Builder withoutTrashed()

Return Value

void

at line 18
static static restoreOrCreate(array<string $, mixed> $attributes = '[]', mixed> $values = '[]')

No description

Parameters

array<string $
mixed> $attributes
mixed> $values

Return Value

static

at line 18
static static createOrRestore(array<string $, mixed> $attributes = '[]', mixed> $values = '[]')

No description

Parameters

array<string $
mixed> $attributes
mixed> $values

Return Value

static