Commit 6b739745 by Callum McIntyre

Added new touch function to eloquent, updates timestamps and immediately saves

Signed-off-by: Callum McIntyre <mcintyre1994@gmail.com>
parent ec13efb7
...@@ -453,6 +453,16 @@ abstract class Model { ...@@ -453,6 +453,16 @@ abstract class Model {
} }
/** /**
*Updates the timestamp on the model and immediately saves it.
*
* @return void
*/
public function touch(){
$this->timestamp();
$this->save();
}
/**
* Get a new fluent query builder instance for the model. * Get a new fluent query builder instance for the model.
* *
* @return Query * @return Query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment