Methods summary
public
|
#
__construct( array $attributes = array(), boolean $exists = false )
Create a new Eloquent model instance.
Create a new Eloquent model instance.
Parameters
- $attributes
array $attributes
- $exists
boolean $exists
|
public
Laravel\Database\Eloquent\Model
|
#
fill( array $attributes, boolean $raw = false )
Hydrate the model with an array of attributes.
Hydrate the model with an array of attributes.
Parameters
- $attributes
array $attributes
- $raw
boolean $raw
Returns
|
public
Laravel\Database\Eloquent\Model
|
#
fill_raw( array $attributes )
Fill the model with the contents of the array.
Fill the model with the contents of the array.
No mutators or accessibility checks will be accounted for.
Parameters
- $attributes
array $attributes
Returns
|
public static
|
#
accessible( array $attributes = null )
Set the accessible attributes for the given model.
Set the accessible attributes for the given model.
Parameters
- $attributes
array $attributes
|
public static
Laravel\Database\Eloquent\Model |false
|
#
create( array $attributes )
Create a new model and store it in the database.
Create a new model and store it in the database.
If save is successful, the model will be returned, otherwise false.
Parameters
- $attributes
array $attributes
Returns
|
public static
integer
|
#
update( mixed $id, array $attributes )
Update a model instance in the database.
Update a model instance in the database.
Parameters
- $id
mixed $id
- $attributes
array $attributes
Returns
integer
|
public static
array
|
#
all( )
Get all of the models in the database.
Get all of the models in the database.
Returns
array
|
public
Laravel\Database\Eloquent\Model
|
#
_with( array $includes )
The relationships that should be eagerly loaded by the query.
The relationships that should be eagerly loaded by the query.
Parameters
Returns
|
public
Relationship
|
#
has_one( string $model, string $foreign = null )
Get the query for a one-to-one association.
Get the query for a one-to-one association.
Parameters
- $model
string $model
- $foreign
string $foreign
Returns
Relationship
|
public
Relationship
|
#
has_many( string $model, string $foreign = null )
Get the query for a one-to-many association.
Get the query for a one-to-many association.
Parameters
- $model
string $model
- $foreign
string $foreign
Returns
Relationship
|
protected
Relationship
|
#
has_one_or_many( string $type, string $model, string $foreign )
Get the query for a one-to-one / many association.
Get the query for a one-to-one / many association.
Parameters
- $type
string $type
- $model
string $model
- $foreign
string $foreign
Returns
Relationship
|
public
Relationship
|
#
belongs_to( string $model, string $foreign = null )
Get the query for a one-to-one (inverse) relationship.
Get the query for a one-to-one (inverse) relationship.
Parameters
- $model
string $model
- $foreign
string $foreign
Returns
Relationship
|
public
Laravel\Database\Eloquent\Relationships\Has_Many_And_Belongs_To
|
#
has_many_and_belongs_to( string $model, string $table = null, string $foreign = null, string $other = null )
Get the query for a many-to-many relationship.
Get the query for a many-to-many relationship.
Parameters
- $model
string $model
- $table
string $table
- $foreign
string $foreign
- $other
string $other
Returns
|
public
boolean
|
#
push( )
Save the model and all of its relations to the database.
Save the model and all of its relations to the database.
Returns
boolean
|
public
boolean
|
#
save( )
Save the model instance to the database.
Save the model instance to the database.
Returns
boolean
|
public
integer
|
#
delete( )
Delete the model from the database.
Delete the model from the database.
Returns
integer
|
public
|
#
timestamp( )
Set the update and creation timestamps on the model.
Set the update and creation timestamps on the model.
|
public
|
#
touch( )
Updates the timestamp on the model and immediately saves it.
Updates the timestamp on the model and immediately saves it.
|
protected
Laravel\Database\Eloquent\Query
|
#
_query( )
Get a new fluent query builder instance for the model.
Get a new fluent query builder instance for the model.
Returns
|
final public
boolean
|
#
sync( )
Sync the original attributes with the current attributes.
Sync the original attributes with the current attributes.
Returns
boolean
|
public
boolean
|
#
changed( string $attribute )
Determine if a given attribute has changed from its original state.
Determine if a given attribute has changed from its original state.
Parameters
- $attribute
string $attribute
Returns
boolean
|
public
boolean
|
#
dirty( )
Determine if the model has been changed from its original state.
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
|
public
string
|
#
table( )
Get the name of the table associated with the model.
Get the name of the table associated with the model.
Returns
string
|
public
array
|
#
get_dirty( )
Get the dirty attributes for the model.
Get the dirty attributes for the model.
Returns
array
|
public
integer
|
#
get_key( )
Get the value of the primary key for the model.
Get the value of the primary key for the model.
Returns
integer
|
public
|
#
set_key( integer $value )
Set the value of the primary key for the model.
Set the value of the primary key for the model.
Parameters
|
public
|
#
get_attribute( string $key )
Get a given attribute from the model.
Get a given attribute from the model.
Parameters
|
public
Laravel\Database\Eloquent\Model
|
#
set_attribute( string $key, mixed $value )
Set an attribute's value on the model.
Set an attribute's value on the model.
Parameters
- $key
string $key
- $value
mixed $value
Returns
|
final public
|
#
purge( string $key )
Remove an attribute from the model.
Remove an attribute from the model.
Parameters
|
public
array
|
#
to_array( )
Get the model attributes and relationships in array form.
Get the model attributes and relationships in array form.
Returns
array
|
protected
array
|
#
fire_event( string $event )
Fire a given event for the model.
Fire a given event for the model.
Parameters
Returns
array
|
public
mixed
|
#
__get( string $key )
Handle the dynamic retrieval of attributes and associations.
Handle the dynamic retrieval of attributes and associations.
Parameters
Returns
mixed
|
public
|
#
__set( string $key, mixed $value )
Handle the dynamic setting of attributes.
Handle the dynamic setting of attributes.
Parameters
- $key
string $key
- $value
mixed $value
|
public
boolean
|
#
__isset( string $key )
Determine if an attribute exists on the model.
Determine if an attribute exists on the model.
Parameters
Returns
boolean
|
public
|
#
__unset( string $key )
Remove an attribute from the model.
Remove an attribute from the model.
Parameters
|
public
mixed
|
#
__call( string $method, array $parameters )
Handle dynamic method calls on the model.
Handle dynamic method calls on the model.
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
mixed
|
public static
mixed
|
#
__callStatic( string $method, array $parameters )
Dynamically handle static method calls on the model.
Dynamically handle static method calls on the model.
Parameters
- $method
string $method
- $parameters
array $parameters
Returns
mixed
|
Properties summary
public
array
|
$attributes
|
array() |
#
All of the model's attributes.
All of the model's attributes.
|
public
array
|
$original
|
array() |
#
The model's attributes in their original state.
The model's attributes in their original state.
|
public
array
|
$relationships
|
array() |
#
The relationships that have been loaded for the query.
The relationships that have been loaded for the query.
|
public
boolean
|
$exists
|
false |
#
Indicates if the model exists in the database.
Indicates if the model exists in the database.
|
public
array
|
$includes
|
array() |
#
The relationships that should be eagerly loaded.
The relationships that should be eagerly loaded.
|
public static
string
|
$key
|
'id' |
#
The primary key for the model on the database table.
The primary key for the model on the database table.
|
public static
array
|
$accessible
|
|
#
The attributes that are accessible for mass assignment.
The attributes that are accessible for mass assignment.
|
public static
array
|
$hidden
|
array() |
#
The attributes that should be excluded from to_array.
The attributes that should be excluded from to_array.
|
public static
boolean
|
$timestamps
|
true |
#
Indicates if the model has update and creation timestamps.
Indicates if the model has update and creation timestamps.
|
public static
string
|
$table
|
|
#
The name of the table associated with the model.
The name of the table associated with the model.
|
public static
string
|
$connection
|
|
#
The name of the database connection that should be used for the model.
The name of the database connection that should be used for the model.
|
public static
string
|
$sequence
|
|
#
The name of the sequence associated with the model.
The name of the sequence associated with the model.
|
public static
integer
|
$per_page
|
20 |
#
The default number of models to show per page when paginating.
The default number of models to show per page when paginating.
|