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

bhosted's avatar

updated_at => false not supported in Laravel 11?

Hi,

Just wondering: After migrating from Laravel 10 to Laravel 11 a couple of days ago, I noticed some errors in our code that was handled just fine in Laravel 10.

It seems to related to setting updated_at to false, e.g. $model->update([ ..., 'updated_at' => false] )

This resulted in Laravel 10 to ignore the updated_at column for this update call. Is this a known difference?

I've solved it by first setting $model->timestamp = false before calling $model->update([...]).

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58
Hi,

In Laravel 11, the behavior you're describing regarding the `updated_at` column has indeed changed. The framework no longer supports setting `updated_at` to `false` directly in the update method to prevent the automatic updating of the timestamp.

Your solution to set `$model->timestamps = false;` before calling `$model->update([...]);` is a valid workaround. This tells Eloquent not to automatically update the `created_at` and `updated_at` timestamps for that particular model instance.

Here's a more detailed example of how you can use this approach:

```php
$model = YourModel::find($id);
$model->timestamps = false;
$model->update([
    // your update array without the 'updated_at' key
]);

Alternatively, if you want to disable automatic timestamps for all updates to a particular model, you can set the $timestamps property to false in the model class itself:

class YourModel extends Model
{
    public $timestamps = false;

    // rest of the model...
}

Remember that this will apply to all instances of YourModel and will affect both created_at and updated_at columns.

If you need more granular control and want to update the updated_at column conditionally, you can use Eloquent's touch() method to manually update it when needed.

I hope this helps!

Please or to participate in this conversation.