Properties

$attributes

$attributes : array

All of the model's attributes.

Type

array

Tags

None found

$original

$original : array

The model's attributes in their original state.

Type

array

Tags

None found

$relationships

$relationships : array

The relationships that have been loaded for the query.

Type

array

Tags

None found

$exists

$exists : boolean

Indicates if the model exists in the database.

Type

boolean

Tags

None found

$includes

$includes : array

The relationships that should be eagerly loaded.

Type

array

Tags

None found

$key

$key : string

The primary key for the model on the database table.

Type

string

Tags

None found

$accessible

$accessible : array

The attributes that are accessible for mass assignment.

Type

array

Tags

None found

$hidden

$hidden : array

The attributes that should be excluded from to_array.

Type

array

Tags

None found

$timestamps

$timestamps : boolean

Indicates if the model has update and creation timestamps.

Type

boolean

Tags

None found

$table

$table : string

The name of the table associated with the model.

Type

string

Tags

None found

$connection

$connection : string

The name of the database connection that should be used for the model.

Type

string

Tags

None found

$sequence

$sequence : string

The name of the sequence associated with the model.

Type

string

Tags

None found

$per_page

$per_page : integer

The default number of models to show per page when paginating.

Type

integer

Tags

None found

Methods

__construct()

__construct(array  $attributes = array(), boolean  $exists = false) : void

Create a new Eloquent model instance.

Parameters

array $attributes
boolean $exists

Tags

None found

fill()

fill(array  $attributes, boolean  $raw = false) : \Laravel\Database\Eloquent\Model

Hydrate the model with an array of attributes.

Parameters

array $attributes
boolean $raw

Returns

LaravelDatabaseEloquentModel

Tags

None found

fill_raw()

fill_raw(array  $attributes) : \Laravel\Database\Eloquent\Model

Fill the model with the contents of the array.

No mutators or accessibility checks will be accounted for.

Parameters

array $attributes

Returns

LaravelDatabaseEloquentModel

Tags

None found

accessible()

accessible(array  $attributes = null) : void

Set the accessible attributes for the given model.

Parameters

array $attributes

static

Tags

None found

create()

create(array  $attributes) : \Laravel\Database\Eloquent\Model|false

Create a new model and store it in the database.

If save is successful, the model will be returned, otherwise false.

Parameters

array $attributes

Returns

LaravelDatabaseEloquentModel|false

static

Tags

None found

update()

update(mixed  $id, array  $attributes) : integer

Update a model instance in the database.

Parameters

mixed $id
array $attributes

Returns

integer

static

Tags

None found

all()

all() : array

Get all of the models in the database.

Returns

array

static

Tags

None found

_with()

_with(array  $includes) : \Laravel\Database\Eloquent\Model

The relationships that should be eagerly loaded by the query.

Parameters

array $includes

Returns

LaravelDatabaseEloquentModel

Tags

None found

has_one()

has_one(string  $model, string  $foreign = null) : \Laravel\Database\Eloquent\Relationship

Get the query for a one-to-one association.

Parameters

string $model
string $foreign

Returns

LaravelDatabaseEloquentRelationship

Tags

None found

has_many()

has_many(string  $model, string  $foreign = null) : \Laravel\Database\Eloquent\Relationship

Get the query for a one-to-many association.

Parameters

string $model
string $foreign

Returns

LaravelDatabaseEloquentRelationship

Tags

None found

belongs_to()

belongs_to(string  $model, string  $foreign = null) : \Laravel\Database\Eloquent\Relationship

Get the query for a one-to-one (inverse) relationship.

Parameters

string $model
string $foreign

Returns

LaravelDatabaseEloquentRelationship

Tags

None found

has_many_and_belongs_to()

has_many_and_belongs_to(string  $model, string  $table = null, string  $foreign = null, string  $other = null) : \Laravel\Database\Eloquent\Relationships\Has_Many_And_Belongs_To

Get the query for a many-to-many relationship.

Parameters

string $model
string $table
string $foreign
string $other

Returns

LaravelDatabaseEloquentRelationshipsHas_Many_And_Belongs_To

Tags

None found

push()

push() : boolean

Save the model and all of its relations to the database.

Returns

boolean

Tags

None found

save()

save() : boolean

Save the model instance to the database.

Returns

boolean

Tags

None found

delete()

delete() : integer

Delete the model from the database.

Returns

integer

Tags

None found

timestamp()

timestamp() : void

Set the update and creation timestamps on the model.

Tags

None found

touch()

touch() : void

Updates the timestamp on the model and immediately saves it.

Tags

None found

sync()

sync() : boolean

Sync the original attributes with the current attributes.

Returns

boolean

final

Tags

None found

changed()

changed(string  $attribute) : boolean

Determine if a given attribute has changed from its original state.

Parameters

string $attribute

Returns

boolean

Tags

None found

dirty()

dirty() : boolean

Determine if the model has been changed from its original state.

Models that haven't been persisted to storage are always considered dirty.

Returns

boolean

Tags

None found

table()

table() : string

Get the name of the table associated with the model.

Returns

string

Tags

None found

get_dirty()

get_dirty() : array

Get the dirty attributes for the model.

Returns

array

Tags

None found

get_key()

get_key() : integer

Get the value of the primary key for the model.

Returns

integer

Tags

None found

set_key()

set_key(integer  $value) : void

Set the value of the primary key for the model.

Parameters

integer $value

Tags

None found

get_attribute()

get_attribute(string  $key) 

Get a given attribute from the model.

Parameters

string $key

Tags

None found

set_attribute()

set_attribute(string  $key, mixed  $value) : \Laravel\Database\Eloquent\Model

Set an attribute's value on the model.

Parameters

string $key
mixed $value

Returns

LaravelDatabaseEloquentModel

Tags

None found

purge()

purge(string  $key) 

Remove an attribute from the model.

Parameters

string $key

final

Tags

None found

to_array()

to_array() : array

Get the model attributes and relationships in array form.

Returns

array

Tags

None found

__get()

__get(string  $key) : mixed

Handle the dynamic retrieval of attributes and associations.

Parameters

string $key

Returns

mixed

Tags

None found

__set()

__set(string  $key, mixed  $value) : void

Handle the dynamic setting of attributes.

Parameters

string $key
mixed $value

Tags

None found

__isset()

__isset(string  $key) : boolean

Determine if an attribute exists on the model.

Parameters

string $key

Returns

boolean

Tags

None found

__unset()

__unset(string  $key) : void

Remove an attribute from the model.

Parameters

string $key

Tags

None found

__call()

__call(string  $method, array  $parameters) : mixed

Handle dynamic method calls on the model.

Parameters

string $method
array $parameters

Returns

mixed

Tags

None found

__callStatic()

__callStatic(string  $method, array  $parameters) : mixed

Dynamically handle static method calls on the model.

Parameters

string $method
array $parameters

Returns

mixed

static

Tags

None found

has_one_or_many()

has_one_or_many(string  $type, string  $model, string  $foreign) : \Laravel\Database\Eloquent\Relationship

Get the query for a one-to-one / many association.

Parameters

string $type
string $model
string $foreign

Returns

LaravelDatabaseEloquentRelationship

Tags

None found

_query()

_query() : \Laravel\Database\Eloquent\Query

Get a new fluent query builder instance for the model.

Returns

LaravelDatabaseEloquentQuery

Tags

None found

fire_event()

fire_event(string  $event) : array

Fire a given event for the model.

Parameters

string $event

Returns

array

Tags

None found