HasTimestamps (Database\Eloquent\Concerns)
HasTimestamps
trait HasTimestamps (View source)
Properties
bool | $timestamps | Indicates if the model should be timestamped. |
Methods
bool | touch() Update the model's update timestamp. | |
$this | setCreatedAt(mixed $value) Set the value of the "created at" attribute. | |
$this | setUpdatedAt(mixed $value) Set the value of the "updated at" attribute. | |
Carbon | freshTimestamp() Get a fresh timestamp for the model. | |
string | freshTimestampString() Get a fresh timestamp for the model. | |
bool | usesTimestamps() Determine if the model uses timestamps. | |
string | getCreatedAtColumn() Get the name of the "created at" column. | |
string | getUpdatedAtColumn() Get the name of the "updated at" column. |
Details
bool touch()
Update the model's update timestamp.
$this setCreatedAt(mixed $value)
Set the value of the "created at" attribute.
$this setUpdatedAt(mixed $value)
Set the value of the "updated at" attribute.
Carbon freshTimestamp()
Get a fresh timestamp for the model.
string freshTimestampString()
Get a fresh timestamp for the model.
bool usesTimestamps()
Determine if the model uses timestamps.
string getCreatedAtColumn()
Get the name of the "created at" column.
string getUpdatedAtColumn()
Get the name of the "updated at" column.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Database/Eloquent/Concerns/HasTimestamps.html