trait HasTimestamps

Properties

bool $timestamps

Indicates if the model should be timestamped.

Methods

bool
touch()

Update the model's update timestamp.

void
updateTimestamps()

Update the creation and update timestamps.

$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

at line 21
bool touch()

Update the model's update timestamp.

Return Value

bool

at line 37
protected void updateTimestamps()

Update the creation and update timestamps.

Return Value

void

at line 56
$this setCreatedAt(mixed $value)

Set the value of the "created at" attribute.

Parameters

mixed $value

Return Value

$this

at line 69
$this setUpdatedAt(mixed $value)

Set the value of the "updated at" attribute.

Parameters

mixed $value

Return Value

$this

at line 81
Carbon freshTimestamp()

Get a fresh timestamp for the model.

Return Value

Carbon

at line 91
string freshTimestampString()

Get a fresh timestamp for the model.

Return Value

string

at line 101
bool usesTimestamps()

Determine if the model uses timestamps.

Return Value

bool

at line 111
string getCreatedAtColumn()

Get the name of the "created at" column.

Return Value

string

at line 121
string getUpdatedAtColumn()

Get the name of the "updated at" column.

Return Value

string