Skip to content

[12.x] Allow touch() to accept multiple columns#59175

Merged
taylorotwell merged 2 commits intolaravel:12.xfrom
devajmeireles:feat/touch-multiple-columns
Mar 13, 2026
Merged

[12.x] Allow touch() to accept multiple columns#59175
taylorotwell merged 2 commits intolaravel:12.xfrom
devajmeireles:feat/touch-multiple-columns

Conversation

@devajmeireles
Copy link
Contributor

This PR extends Builder::touch() and Model::touch() to accept an array of column names, allowing multiple timestamp columns to be updated in a single query.

Before

$model->touch('published_at');

$model->touch('verified_at'); // two queries

After

$model->touch(['published_at', 'verified_at']); // single query

Both touch() and touchQuietly() on the model, as well as Builder::touch(), now accept string|array|null. Full backward compatibility was preserved, ensuring that introducing this feature will not break anything.

@taylorotwell taylorotwell merged commit 651ead2 into laravel:12.x Mar 13, 2026
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants