I am trying to use Carbon in my laravel Controller but getting this error.
$date = Carbon::now();
Class 'App\Http\Controllers\Carbon' not found.
I am trying to use Carbon in my laravel Controller but getting this error.
$date = Carbon::now();
Class 'App\Http\Controllers\Carbon' not found.
Carbon class is not included in your Controller namespace. You need to add the below line at the top of the controller file.
use Carbon\Carbon;
or
use Illuminate\Support\Carbon;