abstract class AbstractModel extends Model

Base model class, building on Eloquent.

Adds the ability for custom relations to be added to a model during runtime. These relations behave in the same way that you would expect; they can be queried, eager loaded, and accessed as an attribute.

Properties

bool $timestamps Indicates if the model should be timestamped. Turn off by default.
protected callable[] $afterSaveCallbacks An array of callbacks to be run once after the model is saved.
protected callable[] $afterDeleteCallbacks An array of callbacks to be run once after the model is deleted.
static array $customCasts
static array $defaults
protected string|null $tableAlias An alias for the table name, used in queries.
string[]|null $uniqueKeys If a model has unique keys, they should be defined here.

Methods

static 
boot()

No description

__construct(array $attributes = [])

No description

array
getCasts()

No description

void
afterSave(callable $callback)

Register a callback to be run once after the model is saved.

void
afterDelete(callable $callback)

Register a callback to be run once after the model is deleted.

array
releaseAfterSaveCallbacks()

No description

array
releaseAfterDeleteCallbacks()

No description

newModelQuery()

No description

qualifyColumn($column)

No description

mixed
withTableAlias(callable $callback)

No description

newCollection(array $models = [])

No description

__sleep()

No description

Details

static boot()

__construct(array $attributes = [])

Parameters

array $attributes

array getCasts()

Return Value

array

void afterSave(callable $callback)

Register a callback to be run once after the model is saved.

Parameters

callable $callback

Return Value

void

void afterDelete(callable $callback)

Register a callback to be run once after the model is deleted.

Parameters

callable $callback

Return Value

void

array releaseAfterSaveCallbacks()

Return Value

array

array releaseAfterDeleteCallbacks()

Return Value

array

newModelQuery()

qualifyColumn($column)

Parameters

$column

mixed withTableAlias(callable $callback)

Parameters

callable $callback

Return Value

mixed

Collection newCollection(array $models = [])

Parameters

array $models

Return Value

Collection

__sleep()