Property | Type | Description | |
---|---|---|---|
$exists | boolean | Indicates if the model exists. | |
$incrementing | boolean | Indicates if the IDs are auto-incrementing. | |
$snakeAttributes | boolean | Indicates whether attributes are snake cased on arrays. | |
$timestamps | boolean | Indicates if the model should be timestamped. |
Property | Type | Description | |
---|---|---|---|
$attributes | array | The model's attributes. | |
$booted | array | The array of booted models. | |
$collection | string | The collection associated with the model. | |
$connection | string | The connection name for the model. | |
$dispatcher | Illuminate\Events\Dispatcher | The event dispatcher instance. | |
$fillable | array | The attributes that are mass assignable. | |
$guarded | array | The attributes that aren't mass assignable. | |
$hidden | array | The attributes that should be hidden for arrays. | |
$mutatorCache | array | The cache of the mutated attributes for each class. | |
$original | array | The model attribute's original state. | |
$perPage | integer | The number of models to return for pagination. | |
$primaryKey | string | The primary key for the model. | |
$relations | array | The loaded relationships for the model. | |
$resolver | LMongo\ConnectionResolverInterface | The connection resolver instance. | |
$softDelete | boolean | Indicates if the model should soft delete. | |
$touches | array | The relationships that should be touched on save. | |
$unguarded | boolean | Indicates if all mass assignment is enabled. | |
$visible | arrays | The attributes that should be visible in arrays. | |
$with | array | The relations to eager load on every query. |
Method | Description | |
---|---|---|
__call ( string $method, array $parameters ) : mixed | Handle dynamic method calls into the method. | |
__callStatic ( string $method, array $parameters ) : mixed | Handle dynamic static method calls into the method. | |
__construct ( array $attributes = [] ) : void | Create a new Eloquent model instance. | |
__get ( string $key ) : mixed | Dynamically retrieve attributes on the model. | |
__isset ( string $key ) : void | Determine if an attribute exists on the model. | |
__set ( string $key, mixed $value ) : void | Dynamically set attributes on the model. | |
__toString ( ) : string | Convert the model to its string representation. | |
__unset ( string $key ) : void | Unset an attribute on the model. | |
all ( array $columns = [] ) : |
Get all of the models from the database. | |
attributesToArray ( ) : array | Convert the model's attributes to an array. | |
belongsTo ( string $related, string $foreignKey = null ) : |
Define an inverse one-to-one or many relationship. | |
belongsToMany ( string $related, string $foreignKey = null, string $otherKey = null ) : |
Define a many-to-many relationship. | |
collection ( string $collection ) : void | Set the collection associated with the model. | |
create ( array $attributes ) : |
Save a new model and return the instance. | |
created ( Closur\Closure | string $callback ) : void | Register a created model event with the dispatcher. | |
creating ( Closur\Closure | string $callback ) : void | Register a creating model event with the dispatcher. | |
delete ( ) : boolean | null | Delete the model from the database. | |
deleted ( Closur\Closure | string $callback ) : void | Register a deleted model event with the dispatcher. | |
deleting ( Closur\Closure | string $callback ) : void | Register a deleting model event with the dispatcher. | |
destroy ( array | integer $ids ) : void | Destroy the models for the given IDs. | |
fill ( array $attributes ) : |
Fill the model with an array of attributes. | |
fillable ( array $fillable ) : |
Set the fillable attributes for the model. | |
find ( mixed $id, array $columns = [] ) : |
Find a model by its primary key. | |
findOrFail ( mixed $id, array $columns = [] ) : |
Find a model by its primary key or throw an exception. | |
flushEventListeners ( ) : void | Remove all of the event listeners for the model. | |
forceDelete ( ) : void | Force a hard delete on a soft deleted model. | |
freshTimestamp ( ) : MongoDate | Get a fresh MongoDate for the model. | |
getAttribute ( string $key ) : mixed | Get an attribute from the model. | |
getAttributes ( ) : array | Get all of the current attributes on the model. | |
getCollection ( ) : string | Get the collection associated with the model. | |
getConnection ( ) : |
Get the database connection for the model. | |
getConnectionName ( ) : string | Get the current connection name for the model. | |
getConnectionResolver ( ) : LMongo\ConnectionResolverInterface | Get the connection resolver instance. | |
getCreatedAtColumn ( ) : string | Get the name of the "created at" column. | |
getDates ( ) : array | Get the attributes that should be converted to dates. | |
getDeletedAtColumn ( ) : string | Get the name of the "deleted at" column. | |
getDirty ( ) : array | Get the attributes that have been changed since last sync. | |
getEventDispatcher ( ) : Illuminate\Events\Dispatcher | Get the event dispatcher instance. | |
getFillable ( ) : array | Get the fillable attributes for the model. | |
getForeignKey ( ) : string | Get the default foreign key name for the model. | |
getHidden ( ) : array | Get the hidden attributes for the model. | |
getIncrementing ( ) : boolean | Get the value indicating whether the IDs are incrementing. | |
getKey ( ) : mixed | Get the value of the model's primary key. | |
getKeyName ( ) : string | Get the primary key for the model. | |
getMutatedAttributes ( ) : array | Get the mutated attributes for a given instance. | |
getObservableEvents ( ) : array | Get the observable event names. | |
getOriginal ( string $key = null, mixed $default = null ) : array | Get the model's original attribute values. | |
getPerPage ( ) : integer | Get the number of models to return per page. | |
getQualifiedDeletedAtColumn ( ) : string | Get the fully qualified "deleted at" column. | |
getRelation ( string $relation ) : mixed | Get a specified relationship. | |
getRelations ( ) : array | Get all the loaded relations for the instance. | |
getTouchedRelations ( ) : array | Get the relationships that are touched on save. | |
getUpdatedAtColumn ( ) : string | Get the name of the "updated at" column. | |
guard ( array $guarded ) : |
Set the guarded attributes for the model. | |
hasGetMutator ( string $key ) : boolean | Determine if a get mutator exists for an attribute. | |
hasMany ( string $related, string $foreignKey = null ) : |
Define a one-to-many relationship. | |
hasOne ( string $related, string $foreignKey = null ) : LMongo\Eloquent\Relation\HasOne | Define a one-to-one relationship. | |
hasSetMutator ( string $key ) : boolean | Determine if a set mutator exists for an attribute. | |
isDirty ( string $attribute ) : boolean | Determine if a given attribute is dirty. | |
isFillable ( string $key ) : boolean | Determine if the given attribute may be mass assigned. | |
isGuarded ( string $key ) : boolean | Determine if the given key is guarded. | |
isSoftDeleting ( ) : boolean | Determine if the model instance uses soft deletes. | |
load ( array | string $relations ) : void | Eager load relations on the model. | |
morphMany ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphMany | Define a polymorphic one-to-many relationship. | |
morphOne ( string $related, string $name, string $type = null, string $id = null ) : LMongo\Eloquent\Relation\MorphOne | Define a polymorphic one-to-one relationship. | |
morphTo ( string $name = null, string $type = null, string $id = null ) : |
Define an polymorphic, inverse one-to-one or many relationship. | |
newCollection ( array $models = [] ) : |
Create a new Collection instance. | |
newFromBuilder ( array $attributes = [] ) : |
Create a new model instance that is existing. | |
newInstance ( array $attributes = [], boolean $exists = false ) : |
Create a new instance of the given model. | |
newQuery ( boolean $excludeDeleted = true ) : |
Get a new query builder for the model's table. | |
newQueryWithDeleted ( ) : |
Get a new query builder that includes soft deletes. | |
observe ( object $class ) : void | Register an observer with the Model. | |
offsetExists ( mixed $offset ) : boolean | Determine if the given attribute exists. | |
offsetGet ( mixed $offset ) : mixed | Get the value for a given offset. | |
offsetSet ( mixed $offset, mixed $value ) : void | Set the value for a given offset. | |
offsetUnset ( mixed $offset ) : void | Unset the value for a given offset. | |
on ( string $connection = null ) : |
Begin querying the model on a given connection. | |
onlyTrashed ( ) : |
Get a new query builder that only includes soft deletes. | |
push ( ) : boolean | Save the model and all of its relationships. | |
query ( ) : |
Begin querying the model. | |
reguard ( ) : void | Enable the mass assignment restrictions. | |
relationsToArray ( ) : array | Get the model's relationships in array form. | |
replicate ( ) : |
Clone the model into a new, non-existing instance. | |
resolveConnection ( string $connection = null ) : |
Resolve a connection instance. | |
restore ( ) : boolean | null | Restore a soft-deleted model instance. | |
save ( ) : boolean | Save the model to the database. | |
saved ( Closur\Closure | string $callback ) : void | Register a saved model event with the dispatcher. | |
saving ( Closur\Closure | string $callback ) : void | Register a saving model event with the dispatcher. | |
setAttribute ( string $key, mixed $value ) : void | Set a given attribute on the model. | |
setConnection ( string $name ) : void | Set the connection associated with the model. | |
setConnectionResolver ( LMongo\ConnectionResolverInterface $resolver ) : void | Set the connection resolver instance. | |
setCreatedAt ( mixed $value ) : void | Set the value of the "created at" attribute. | |
setEventDispatcher ( Illuminate\Events\Dispatcher $dispatcher ) : void | Set the event dispatcher instance. | |
setHidden ( array $hidden ) : void | Set the hidden attributes for the model. | |
setIncrementing ( boolean $value ) : void | Set whether IDs are incrementing. | |
setPerPage ( integer $perPage ) : void | Set the number of models ot return per page. | |
setRawAttributes ( array $attributes, boolean $sync = false ) : void | Set the array of model attributes. No checking is done. | |
setRelation ( string $relation, mixed $value ) : |
Set the specific relationship in the model. | |
setRelations ( array $relations ) : |
Set the entire relations array on the model. | |
setSoftDeleting ( boolean $enabled ) : void | Set the soft deleting property on the model. | |
setTouchedRelations ( array $touches ) : void | Set the relationships that are touched on save. | |
setUnguardState ( boolean $state ) : void | Set "unguard" to a given state. | |
setUpdatedAt ( mixed $value ) : void | Set the value of the "updated at" attribute. | |
setVisible ( array $visible ) : void | Set the visible attributes for the model. | |
syncOriginal ( ) : |
Sync the original attributes with the current. | |
toArray ( ) : array | Convert the model instance to an array. | |
toJson ( integer $options ) : string | Convert the model instance to JSON. | |
totallyGuarded ( ) : boolean | Determine if the model is totally guarded. | |
touch ( ) : boolean | Update the model's update timestamp. | |
touchOwners ( ) : void | Touch the owning relations of the model. | |
touches ( string $relation ) : boolean | Determine if the model touches a given relation. | |
trashed ( ) : boolean | Determine if the model instance has been soft-deleted. | |
unguard ( ) : void | Disable all mass assignable restrictions. | |
unsetEventDispatcher ( ) : void | Unset the event dispatcher for models. | |
update ( array $attributes = [] ) : mixed | Update the model in the database. | |
updated ( Closur\Closure | string $callback ) : void | Register an updated model event with the dispatcher. | |
updating ( Closur\Closure | string $callback ) : void | Register an updating model event with the dispatcher. | |
usesTimestamps ( ) : boolean | Determine if the model uses timestamps. | |
with ( array | string $relations ) : |
Being querying a model with eager loading. | |
withTrashed ( ) : |
Get a new query builder that includes soft deletes. |
Method | Description | |
---|---|---|
asDateTime ( mixed $value ) : DateTime | Return a timestamp as DateTime object. | |
boot ( ) : void | The "booting" method of the model. | |
decrement ( string $column, integer $amount = 1 ) : integer | Decrement a column's value by a given amount. | |
finishSave ( ) : void | Finish processing on a successful save operation. | |
fireModelEvent ( string $event, boolean $halt = true ) : mixed | Fire the given event for the model. | |
fromDateTime ( DateTim\DateTime | integer $value ) : string | Convert a DateTime to a storable string. | |
getArrayableAttributes ( ) : array | Get an attribute array of all arrayable attributes. | |
getAttributeFromArray ( string $key ) : mixed | Get an attribute from the $attributes array. | |
getAttributeValue ( string $key ) : mixed | Get a plain attribute (not a relationship). | |
getDateFormat ( ) : string | Get the format for database stored dates. | |
getMorphs ( string $name, string $type, string $id ) : array | Get the polymorphic relationship columns. | |
increment ( string $column, integer $amount = 1 ) : integer | Increment a column's value by a given amount. | |
incrementOrDecrement ( string $column, integer $amount, string $method ) : integer | Run the increment or decrement method on the model. | |
insertAndSetId ( |
Insert the given attributes and set the ID on the model. | |
mutateAttribute ( string $key, mixed $value ) : mixed | Get the value of an attribute using its mutator. | |
newBaseQueryBuilder ( ) : |
Get a new query builder instance for the connection. | |
performDeleteOnModel ( ) : void | Perform the actual delete query on this model instance. | |
performInsert ( $query ) : boolean | Perform a model insert operation. | |
performUpdate ( $query ) : boolean | Perform a model update operation. | |
registerModelEvent ( string $event, Closur\Closure | string $callback ) : void | Register a model event with the dispatcher. | |
setKeysForSaveQuery ( $query ) : |
Set the keys for a save update query. | |
updateTimestamps ( ) : void | Update the creation and update timestamps. |
public __construct ( array $attributes = [] ) : void | ||
$attributes | array | |
return | void |
public __toString ( ) : string | ||
return | string |
protected asDateTime ( mixed $value ) : DateTime | ||
$value | mixed | |
return | DateTime |
public attributesToArray ( ) : array | ||
return | array |
public collection ( string $collection ) : void | ||
$collection | string | |
return | void |
public static findOrFail ( mixed $id, array $columns = [] ) : |
||
$id | mixed | |
$columns | array | |
return |
protected finishSave ( ) : void | ||
return | void |
public static flushEventListeners ( ) : void | ||
return | void |
public forceDelete ( ) : void | ||
return | void |
public freshTimestamp ( ) : MongoDate | ||
return | MongoDate |
protected fromDateTime ( DateTim\DateTime | integer $value ) : string | ||
$value | DateTim\DateTime | integer | |
return | string |
protected getArrayableAttributes ( ) : array | ||
return | array |
public getAttribute ( string $key ) : mixed | ||
$key | string | |
return | mixed |
protected getAttributeFromArray ( string $key ) : mixed | ||
$key | string | |
return | mixed |
protected getAttributeValue ( string $key ) : mixed | ||
$key | string | |
return | mixed |
public getAttributes ( ) : array | ||
return | array |
public getCollection ( ) : string | ||
return | string |
public getConnection ( ) : |
||
return |
public getConnectionName ( ) : string | ||
return | string |
public static getConnectionResolver ( ) : LMongo\ConnectionResolverInterface | ||
return | LMongo\ConnectionResolverInterface |
public getCreatedAtColumn ( ) : string | ||
return | string |
protected getDateFormat ( ) : string | ||
return | string |
public getDeletedAtColumn ( ) : string | ||
return | string |
public static getEventDispatcher ( ) : Illuminate\Events\Dispatcher | ||
return | Illuminate\Events\Dispatcher |
public getFillable ( ) : array | ||
return | array |
public getForeignKey ( ) : string | ||
return | string |
public getIncrementing ( ) : boolean | ||
return | boolean |
public getKeyName ( ) : string | ||
return | string |
public getMutatedAttributes ( ) : array | ||
return | array |
public getObservableEvents ( ) : array | ||
return | array |
public getPerPage ( ) : integer | ||
return | integer |
public getQualifiedDeletedAtColumn ( ) : string | ||
return | string |
public getRelation ( string $relation ) : mixed | ||
$relation | string | |
return | mixed |
public getRelations ( ) : array | ||
return | array |
public getTouchedRelations ( ) : array | ||
return | array |
public getUpdatedAtColumn ( ) : string | ||
return | string |
public hasGetMutator ( string $key ) : boolean | ||
$key | string | |
return | boolean |
public hasSetMutator ( string $key ) : boolean | ||
$key | string | |
return | boolean |
protected insertAndSetId ( |
||
$query | ||
$attributes | array | |
return | void |
public isFillable ( string $key ) : boolean | ||
$key | string | |
return | boolean |
public isSoftDeleting ( ) : boolean | ||
return | boolean |
protected newBaseQueryBuilder ( ) : |
||
return |
public newCollection ( array $models = [] ) : |
||
$models | array | |
return |
public newFromBuilder ( array $attributes = [] ) : |
||
$attributes | array | |
return |
public newInstance ( array $attributes = [], boolean $exists = false ) : |
||
$attributes | array | |
$exists | boolean | |
return |
public newQueryWithDeleted ( ) : |
||
return |
public offsetExists ( mixed $offset ) : boolean | ||
$offset | mixed | |
return | boolean |
public offsetUnset ( mixed $offset ) : void | ||
$offset | mixed | |
return | void |
public static onlyTrashed ( ) : |
||
return |
protected performDeleteOnModel ( ) : void | ||
return | void |
protected performInsert ( $query ) : boolean | ||
return | boolean |
protected performUpdate ( $query ) : boolean | ||
return | boolean |
public static query ( ) : |
||
return |
public relationsToArray ( ) : array | ||
return | array |
public replicate ( ) : |
||
return |
public static resolveConnection ( string $connection = null ) : |
||
$connection | string | |
return |
public setConnection ( string $name ) : void | ||
$name | string | |
return | void |
public static setConnectionResolver ( LMongo\ConnectionResolverInterface $resolver ) : void | ||
$resolver | LMongo\ConnectionResolverInterface | |
return | void |
public setCreatedAt ( mixed $value ) : void | ||
$value | mixed | |
return | void |
public static setEventDispatcher ( Illuminate\Events\Dispatcher $dispatcher ) : void | ||
$dispatcher | Illuminate\Events\Dispatcher | |
return | void |
public setIncrementing ( boolean $value ) : void | ||
$value | boolean | |
return | void |
protected setKeysForSaveQuery ( $query ) : |
||
return |
public setPerPage ( integer $perPage ) : void | ||
$perPage | integer | |
return | void |
public setRelation ( string $relation, mixed $value ) : |
||
$relation | string | |
$value | mixed | |
return |
public setRelations ( array $relations ) : |
||
$relations | array | |
return |
public setSoftDeleting ( boolean $enabled ) : void | ||
$enabled | boolean | |
return | void |
public setTouchedRelations ( array $touches ) : void | ||
$touches | array | |
return | void |
public static setUnguardState ( boolean $state ) : void | ||
$state | boolean | |
return | void |
public setUpdatedAt ( mixed $value ) : void | ||
$value | mixed | |
return | void |
public setVisible ( array $visible ) : void | ||
$visible | array | |
return | void |
public syncOriginal ( ) : |
||
return |
public totallyGuarded ( ) : boolean | ||
return | boolean |
public touchOwners ( ) : void | ||
return | void |
public static unsetEventDispatcher ( ) : void | ||
return | void |
protected updateTimestamps ( ) : void | ||
return | void |
public usesTimestamps ( ) : boolean | ||
return | boolean |
public static withTrashed ( ) : |
||
return |
protected static array $booted | ||
return | array |
protected string $collection | ||
return | string |
protected string $connection | ||
return | string |
protected static Dispatcher,Illuminate\Events $dispatcher | ||
return | Illuminate\Events\Dispatcher |
protected array $fillable | ||
return | array |
protected array $guarded | ||
return | array |
public bool $incrementing | ||
return | boolean |
protected static array $mutatorCache | ||
return | array |
protected array $original | ||
return | array |
protected int $perPage | ||
return | integer |
protected string $primaryKey | ||
return | string |
protected array $relations | ||
return | array |
protected static ConnectionResolverInterface,LMongo $resolver | ||
return | LMongo\ConnectionResolverInterface |
public static bool $snakeAttributes | ||
return | boolean |
protected bool $softDelete | ||
return | boolean |
public bool $timestamps | ||
return | boolean |
protected array $touches | ||
return | array |
protected static bool $unguarded | ||
return | boolean |
protected arrays $visible | ||
return | arrays |
protected array $with | ||
return | array |