Documentation

HasTimestamps

Table of Contents

$timestamps  : bool
Indicates if the model should be timestamped.
freshTimestamp()  : Carbon
Get a fresh timestamp for the model.
freshTimestampString()  : string
Get a fresh timestamp for the model.
getCreatedAtColumn()  : string
Get the name of the "created at" column.
getUpdatedAtColumn()  : string
Get the name of the "updated at" column.
setCreatedAt()  : $this
Set the value of the "created at" attribute.
setUpdatedAt()  : $this
Set the value of the "updated at" attribute.
touch()  : bool
Update the model's update timestamp.
usesTimestamps()  : bool
Determine if the model uses timestamps.
updateTimestamps()  : void
Update the creation and update timestamps.

Properties

$timestamps

Indicates if the model should be timestamped.

public bool $timestamps = true

Methods

freshTimestampString()

Get a fresh timestamp for the model.

public freshTimestampString() : string
Return values
string

getCreatedAtColumn()

Get the name of the "created at" column.

public getCreatedAtColumn() : string
Return values
string

getUpdatedAtColumn()

Get the name of the "updated at" column.

public getUpdatedAtColumn() : string
Return values
string

setCreatedAt()

Set the value of the "created at" attribute.

public setCreatedAt(mixed $value) : $this
Parameters
$value : mixed
Return values
$this

setUpdatedAt()

Set the value of the "updated at" attribute.

public setUpdatedAt(mixed $value) : $this
Parameters
$value : mixed
Return values
$this

touch()

Update the model's update timestamp.

public touch() : bool
Return values
bool

usesTimestamps()

Determine if the model uses timestamps.

public usesTimestamps() : bool
Return values
bool

updateTimestamps()

Update the creation and update timestamps.

protected updateTimestamps() : void
Return values
void

Search results