Class Carbon\Carbon not found

Yes, it can work as @oli-folkerd 's answer. However, as seen in Laracasts (Laravel 5 Fundamentals series Video 10 "forms" min 16:55), almost in top of your ControllerClass php file, just add the following (or import the class if your php editor allows you do so):

use Carbon\Carbon;

Now you can simply use Carbon

$input['published_at'] = Carbon::now();

without having to add Carbon\


you need to add the line:

'Carbon' => 'Carbon\Carbon',

to the bottom of the 'aliases' array in app/config/app.php this will make the carbon library available everywhere in laravel.


You this class in controller of Laravel.

use Carbon\Carbon;

then you simply define the carbon command for print the current date

$date = Carbon::now();