Illuminate\Database\Eloquent\Model::touch PHP Method

touch() public method

Update the model's update timestamp.
public touch ( ) : boolean
return boolean
    public function touch()
    {
        if (!$this->timestamps) {
            return false;
        }
        $this->updateTimestamps();
        return $this->save();
    }

Usage Example

Example #1
0
 public function save(Model $model)
 {
     if ($model->getDirty()) {
         return $model->save();
     } else {
         return $model->touch();
     }
 }
All Usage Examples Of Illuminate\Database\Eloquent\Model::touch
Model