Merge pull request #902 from JesseObrien/feature/eloquent-update-timestamp
Feature/eloquent update timestamp
This commit is contained in:
commit
a9d27ba79c
|
@ -218,9 +218,11 @@ public static function update($id, $attributes)
|
||||||
{
|
{
|
||||||
$model = new static(array(), true);
|
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue