Merge pull request #902 from JesseObrien/feature/eloquent-update-timestamp
Feature/eloquent update timestamp
This commit is contained in:
@@ -218,9 +218,11 @@ abstract class Model {
|
||||
{
|
||||
$model = new static(array(), true);
|
||||
|
||||
if (static::$timestamps) $attributes['updated_at'] = new \DateTime;
|
||||
$model->fill($attributes);
|
||||
|
||||
return $model->query()->where($model->key(), '=', $id)->update($attributes);
|
||||
if (static::$timestamps) $model->timestamp();
|
||||
|
||||
return $model->query()->where($model->key(), '=', $id)->update($model->attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user