Neon Tsunami

Eloquent model without updated_at (Laravel 5.5)

September 14, 2017

It’s changed a little through the different versions of Laravel 5, but it looks as though Laravel 5.5 has just received an official way to disable the updated_at timestamp on your Eloquent models. PR #21178 allows you to set a constant on your model which instructs Eloquent to not attempt and set the timestamp.

class User extends Model
{
    // Do not set updated_at timestamp.
    const UPDATED_AT = null;
}

A blog about Laravel & Rails, written by Dwight Watson.