F
Filamentβ€’8mo ago
ericmp

Where Carbon sets it's locale?

By default, in a Laravel app, Carbon locale is automatically set. It will grab the app locale. I'd like to know where is it doing it. I cloned the laravel framework repo and I'm trying to find it but im not lucky at the moment
3 Replies
Lara Zeus
Lara Zeusβ€’8mo ago
if you want to override it: Carbon::setlocale(config('app.locale')); if you want to find it for other reason πŸ™‚ IDK
ericmp
ericmpβ€’8mo ago
2nd (,: i wanna find it to apply it also to the Number helper so annoying having to:
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
Number::useLocale($this->app->getLocale());
}
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
Number::useLocale($this->app->getLocale());
}
in each laravel app so i want it to work like carbon just grab my localeeee u know?
Lara Zeus
Lara Zeusβ€’8mo ago
not really sorry πŸ™‚ not sure if there is any config for the Numbers! check it namespace
Want results from more Discord servers?
Add your server