Timestamps
Enabling Timestamps
Include the Timestamps
in your model to enable the timestamping mechanism as follow:
When including the Timestamps
module, the following behavior is inserted in
the model:
Timestamps are not exactly implemented as described because database updates
are skipped when no attributes changed during a save
.
The above behavior would have the effect of always changing the attributes
since callbacks are always triggered even when no attributes changed.
This means that the updated_at
timestamp is only set when a database
update query is performed.
You may use touch()
on an instance to update the updated_at
field.