@xtremer360 You definitely don't want that set mutator:
public function setPublishedAtAttribute($date)
{
$this->attributes['published_at'] = Carbon::parse('Y-m-d', $date);
}
This is storing a Carbon object in your attributes, while you want a datetime string there.
With this mutator you have inconsistency:
$news = new NewsArticle;
$news->published_at = '2015-02-05';
$news->published_at; // Feb 5, 2015
// but
$news = NewsArticle::first();
$news->published_at; // error that you just pasted above
You need Carbon object only when you are accessing the date property, not when you are setting it.
Now, what you might want is not using mutators at all, just $dates = ['published_at'];. Then whenever you retrieve the published_at you get it as a nice Carbon object, that you can use however you need in given case. Like:
$news1->published_at->diffForHumans($news2->published_at); // 5 days after
$news1->published_at->toFormattedDateString(); // Feb 5, 2015
$news1->published_at->diffForHumans(); // 2 days ago
This gives you more flexibility than using accessor, that enforces string value, which is what you are trying now. I suggest using Presenter that wraps your model and does it, if you really want to avoid calling $news->published_at->toFormattedDateString() eg. in your view.