All you need to do is add a use statement to the top of the file you want to use Carbon in (but below the namespace), like so:
use Carbon\Carbon;
Then you can use it like normally. No need for aliases and adding it to the providers array is just wrong. Only classes that extend Illuminate\Support\ServiceProvider should be added there.
Thanks a lot for your quick response. That work fine.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community