Support the ongoing development of Laravel.io →
Installation Configuration Packages
Last updated 2 years ago.
0

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.

Last updated 2 years ago.
0

Thanks a lot for your quick response. That work fine.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

birdiebel birdiebel Joined 28 Nov 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.