bezhanSalleh / filament-language-switch

A versatile and user-friendly plugin designed for Filament Panels.
MIT License
210 stars 45 forks source link

Carbon locale shouldn't be set #9

Closed ManuDoni closed 1 year ago

ManuDoni commented 1 year ago

The carbon locale is working, but because of a carbon service provider, not thanks to this package.

https://github.com/bezhanSalleh/filament-language-switch/blob/1a5bc18545d8791190c72ef7ec72780b91b2c2ac/src/Http/Middleware/SwitchLanguageLocale.php#L25

This should be:

if (config('filament-language-switch.carbon')) { 

But the Carbon package registers a listener that sets the locale to all carbon classes, when the laravel locale changes, in a service provider.

You can find it in vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php

I think that it is all working but the filament-language-switch.carbon config should be removed

bezhanSalleh commented 1 year ago

tnx.