taylorotwell/eloquent — Issue #12: Timestamps should use $this->attributes instead of $this->updated_at
Author: lomboo
Created: 2012-02-09 14:47:17+00:00
State: open

The timestamp method

```
protected function timestamp()
{
$this->updated_at = date('Y-m-d H:i:s');

if ( ! $this->exists) $this->created_at = $this->updated_at;
}
```

Should be

```
protected function timestamp()
{
$this->updated_at = date('Y-m-d H:i:s');

if ( ! $this->exists) $this->created_at = $this->attributes['updated_at'];
}
```

In case someone overrides the __get method.

e.g. I return a DateTime object when I do $model->updated_at, so the $model->save() operation will fail because timestamp assigns a DateTime to created_at instead of a plain string.