Aha, would probably help if I put use Carbon\Carbon at the top of my artisan class. Fixed.
Put
use Carbon/Carbon
at the top of the file might work.
And, as you probably know, you can just do \Carbon\Carbon::method() in your class without aliasing the namespace at the top.
Or add to aliases: 'Carbon' => 'Carbon\Carbon',
so you can use it everywhere
I added carbon Facade as "use Carbon/Carbon" and also pass it with aliases but doesn't work yet.
return view('web.home',array('titles'=>$titles,'declarations'=>$declarations,'Carbon' => 'Carbon\Carbon'));
in view i used carbon as below:
Carbon::now()->subSeconds($declaration->created_at)->diffForHumans()
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community