How to Fix it Call to Member Function diffForHumans() on String in Laravel
You can read this article to fix it call to member function diffForHumans() on a string in Laravel. With the error-free solutions.
Laravel DB Facade does not return eloquent objects, created_at and updated_at are not of type Datetime. Articulate article DateTime occurrence returns a case of Carbon.
No need to add a mutator for post_on date because you add it to $dates also you set a mutator on created_at instead of post_on.
Solution :
created_at comes as a string, you will have to parse it for Carbon to work.
{{ \Carbon\Carbon::parse($results->created_at)->diffForHumans() }}