ctoma
3 years ago

Use ->update() without updating timestamps

Posted 3 years ago by ctoma

So I have a query that updates many hundreds of rows at a time, eg

Model::where('something', '=', $something)->update(['status' => 'Unallocated']);

How can I run that query without updating the timestamps? I know that I could use the normal Query Builder instead, but I have certain model events that need to fire when this takes place too.

Is there any way to mass update, but not update the timestamps with Eloquent?

Please sign in or create an account to participate in this conversation.