Change timestamps names in Laravel
By default, Eloquent expects created_at
and updated_at
columns to exist on your tables. If you do not wish to have these columns automatically managed by Eloquent, set the $timestamps
property on your model to false:
class Citizen extends Model
{
public $timestamps = false;
// ...
}
If you need to customize the names of the columns used to store the timestamps, you may set the CREATED_AT
and UPDATED_AT
constants in your model:
class Citizen extends Model
{
const CREATED_AT = 'date_of_creation';
const UPDATED_AT = 'date_of_last_update';
// ...
}