2015-08-08 17 views
0

有人可以幫我解決這個錯誤嗎?Laravel setPublishedAtAttribute error

超載財產應用程序\文章:: $ atributes的間接修改沒有影響

下面的代碼:

public function setPublishedAtAttribute($date){ 
    $this->atributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date); 
} 

我試圖時鐘添加到我的published_at列...

+0

請看看這個問題的一些更多信息:http://stackoverflow.com/questions/10454779/php-indirect-modification-of-overloaded-property – killthrush

回答

0

哦,我已經發布了幾分鐘後,我發佈了這個問題...

$this->attributes['published_at'] = Carbon::createFromFormat('Y-m-d', $date); 

我錯過了屬性中的一個「t」字母。 :)

相關問題