movemoveapp / laravel-dadata

PHP SDK Laravel пакет работы с сервисом DaData.ru, для исправления синтаксических ошибок в информации контактных данных клиентов сайта и вывода подсказок поля форм.
MIT License
43 stars 32 forks source link

The package breaks the Russian localization for Carbon #27

Open eugenemusienko opened 2 years ago

eugenemusienko commented 2 years ago

When installing the package, the Russian localization of Carbon breaks down.

'locale' => 'ru'

config/app.php

$date = Carbon::now(); $dayName = $date->getTranslatedDayName(); // 'Monday', but without the package it would be 'Понедельник'

dmitry-kulikov commented 1 month ago

I have the same problem. I believe the reason is that DaDataServiceProvider extends Carbon\Laravel\ServiceProvider. Instead it should extend Illuminate\Support\ServiceProvider. Cannot find workaround

dmitry-kulikov commented 1 month ago

I found workaround. Add new provider

<?php

declare(strict_types=1);

namespace App\Providers;

use Carbon\Laravel\ServiceProvider;

final class CarbonServiceProvider extends ServiceProvider
{
}

then register it in config/app.php. Thats all, Carbon localization works now