Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Using model timestamps without updated_at

Hello,

I needed to be able to use timestamps for the updateOrCreate method, however without updated_at column since it doesn't exist, and I am using several other columns for updating.

I found this post from SO: https://stackoverflow.com/questions/19937565/disable-laravels-eloquent-timestamps

And I checked it on Laravel 10, and it's also working. I added const UPDATED_AT = null; to the top of the model and I was able to use the created_at timestamp with no errors anymore.

But the post is very old, using Laravel 5, and I did not find anything about it in the docs. So could using const UPDATED_AT = null; cause some issues even though it works right now?

Thanks

0 likes
1 reply

Please or to participate in this conversation.