Timestamps<T> mixin

Superclass constraints

Properties

appends Map<String, dynamic>
The accessors to append to the model's array form.
no setterinherited
attributes Map<String, dynamic>
Get all of the current attributes on the model.
no setterinherited
casts Map<String, dynamic>
The attributes that should be cast to native types.
no setterinherited
createdAt DateTime?
Get the created_at value
getter/setter pair
createdAtColumn String
The name of the "created at" column
no setter
exists bool
getter/setter pairinherited
fillable List<String>
The attributes that are mass assignable.
no setterinherited
guarded List<String>
The attributes that aren't mass assignable.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hidden List<String>
The attributes that should be hidden for serialization.
no setterinherited
id int?
getter/setter pairinherited
original Map<String, dynamic>
Get the original attributes.
no setterinherited
primaryKey String
no setterinherited
query QueryBuilderInterface<T>
Get a new query builder for the model's table.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
table String
no setterinherited
tableName String
no setterinherited
timestamps bool
Whether to use timestamps on this model
no setter
updatedAt DateTime?
Get the updated_at value
getter/setter pair
updatedAtColumn String
The name of the "updated at" column
no setter
visible List<String>
The attributes that should be visible in serialization.
no setterinherited

Methods

all() Future<List<T>>
Get all models.
inherited
append(List<String> attributes) → void
Append attributes.
inherited
castAttribute(String key, dynamic value) → dynamic
Cast an attribute to its declared Dart type.
inherited
decrement(String column, [int amount = 1]) Future<void>
Decrement a column's value.
inherited
delete() Future<bool>
Delete the model from the database.
inherited
except(List<String> keys) Map<String, dynamic>
Get all attributes except the given keys.
inherited
fill(Map<String, dynamic> attributes) → T
Fill the model with an array of attributes.
inherited
find(dynamic id) Future<T?>
Find a model by its primary key.
inherited
findOrFail(dynamic id) Future<T>
Find a model by its primary key or throw an exception.
inherited
forceFill(Map<String, dynamic> attributes) → T
Force fill the model with an array of attributes.
inherited
fresh([List<String> withRelations = const []]) Future<T?>
Get a fresh instance of the model from the database.
inherited
fromJson(Map<String, dynamic> json) → void
Initialize from database record
inherited
getAttribute(String key) → dynamic
Get an attribute from the model.
inherited
getDirty() Map<String, dynamic>
Get the attributes that have been changed since the last sync.
inherited
getKey() → dynamic
inherited
getOriginal(String key, [dynamic defaultValue]) → dynamic
Get an original attribute value.
inherited
getRawAttribute(String key, [dynamic defaultValue]) → dynamic
Get a raw attribute without casting.
inherited
hasAttribute(String key) bool
Check if the model has a specific attribute.
inherited
hasCast(String key) bool
Determine if an attribute has a cast.
inherited
hasOriginal(String key) bool
Check if the model has a specific original attribute.
inherited
increment(String column, [int amount = 1]) Future<void>
Increment a column's value.
inherited
isClean([dynamic attributes]) bool
Check if the model or specific attribute is clean.
inherited
isDirty([dynamic attributes]) bool
Check if the model or specific attribute is dirty.
inherited
isFillable(String key) bool
Determine if the given attribute may be mass assigned.
inherited
makeHidden(List<String> attributes) → void
Make attributes hidden.
inherited
makeVisible(List<String> attributes) → void
Make attributes visible.
inherited
mergeAttributes(Map<String, dynamic> attributes) → void
Merge new attributes into the model.
inherited
newFactory(Map<String, dynamic> data) → T
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
only(List<String> keys) Map<String, dynamic>
Get a subset of attributes.
inherited
refresh() Future<void>
Refresh the model from the database.
inherited
save() Future<bool>
Override save to automatically update timestamps
override
setAttribute(String key, dynamic value) → void
Set a given attribute on the model.
inherited
setRawAttribute(String key, dynamic value) → void
Set a raw attribute without casting.
inherited
syncOriginal() → void
Sync the original attributes with the current.
inherited
toDatabaseMap() Map<String, dynamic>
Prepare the model for database insertion/update.
inherited
toJson() Map<String, dynamic>
Convert the model instance to JSON.
inherited
toJsonAsync() Future<Map<String, dynamic>>
inherited
toMap() Map<String, dynamic>
Convert the model instance to a map.
inherited
toMapAsync() Future<Map<String, dynamic>>
Convert the model instance to a map, resolving any Future values.
inherited
toString() String
A string representation of this object.
inherited
update(Map<String, dynamic> attributes) Future<bool>
Update the model in the database.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited