Skip to content

Commit d9f9c3b

Browse files
[9.x] Document withoutTimestamps (laravel#8238)
* document withoutTimestamps * Update eloquent.md Co-authored-by: Taylor Otwell <[email protected]>
1 parent 09436a4 commit d9f9c3b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

eloquent.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ If you need to customize the names of the columns used to store the timestamps,
310310
const UPDATED_AT = 'updated_date';
311311
}
312312

313+
If you would like to perform model operations without the model having its `updated_at` timestamp modified, you may operate on the model within a closure given to the `withoutTimestamps` method:
314+
315+
Model::withoutTimestamps(fn () => $post->incrememt(['reads']));
316+
313317
<a name="database-connections"></a>
314318
### Database Connections
315319

0 commit comments

Comments
 (0)