I want only use created_at , how to do it?
I know:
This can custom timestamps name
const CREATED_AT = \'created\';
const UPDATED_AT = \'updat
On your model set
const UPDATED_AT = null;
or
const CREATED_AT = null;
it stops Laravel trying to update the updated_at/created_at field
It works for Laravel 5.8
And it is better than overwrite: setUpdatedAt in your model
public function setUpdatedAt($value) : self
{
// Do nothing.
return $this;
}
because it is shorter and because the check for if (! is_null(static::UPDATED_AT) is happening in source code earlier than triggering
setUpdatedAt