Dwight Watson's blog

Eloquent model without updated_at (Laravel 5.5)

This blog post was originally published a little while ago. Please consider that it may no longer be relevant or even accurate.

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 by Dwight Watson;

Picture of Dwight Watson

Follow me on Twitter, or GitHub.