Class 'App\Carbon\Carbon' not found Laravel 5

In the context of the helpers file, I believe Carbon\Carbon = App\Carbon\Carbon

Whereas \Carbon\Carbon would be pulling in what you want!

Using the \ at the beginning refers to a sort of global namespace.


After going through this, i found a way out, it might help someone there.

In laravel go to app.php, go to aliases and add 'Carbon' => 'Carbon\Carbon'. Then use this in blade to format it e.g.

<span>{{  Carbon::createFromTimeStamp(strtotime($message->created_at))->diffForHumans()}}</span>

.Done.


Use Carbon:

use Carbon\Carbon;