From 0161273010fd5217d0f0b2e1ee03066d2204fcb8 Mon Sep 17 00:00:00 2001 From: Callum McIntyre Date: Mon, 3 Sep 2012 22:23:58 +0100 Subject: [PATCH] Added documentation for the touch() function Signed-off-by: Callum McIntyre --- laravel/documentation/database/eloquent.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/laravel/documentation/database/eloquent.md b/laravel/documentation/database/eloquent.md index cbcf83c9..45969c79 100644 --- a/laravel/documentation/database/eloquent.md +++ b/laravel/documentation/database/eloquent.md @@ -132,6 +132,11 @@ ## Inserting & Updating Models Next, add **created_at** and **updated_at** date columns to your table. Now, whenever you save the model, the creation and update timestamps will be set automatically. You're welcome. +In some cases it may be useful to update the **updated_at** date column without actually modifying any data within the model. Simply use the **touch** method, which will also automatically save the changes immediately: + + $comment = Comment::find(1); + $comment->touch(); + > **Note:** You can change the default timezone of your application in the **application/config/application.php** file.