qcod / laravel-app-settings

Store settings in database with a manager UI for your Laravel app
MIT License
338 stars 53 forks source link

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) #20

Closed MuhammadAdeelAhmad closed 4 years ago

MuhammadAdeelAhmad commented 4 years ago

Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)

this error display after installtaion package and when we remove string then come more issues

saqueib commented 4 years ago

can you share laravel and package version so I can debug it. must be some breaking change

MuhammadAdeelAhmad commented 4 years ago

Laravel Framework 5.8.35 Latest Version on Packagist :v1.2.0 app-setting-issue solution2 i resolve issue from edit this file by removing string from all parameters.

saqueib commented 4 years ago

You should not edit a file under vendors/ folder. check this might help https://github.com/laravel/framework/issues/30655

MuhammadAdeelAhmad commented 4 years ago

yes should not edit, but i can't resolve issue without it, how resolve without this editing?

CyberPunkCodes commented 4 years ago

yes should not edit, but i can't resolve issue without it, how resolve without this editing?

This issue is solved by downgrading the offending package to a previously known working version.

Run composer require symfony/translation:4.3.8 from the command line, to downgrade the package, which should fix the error.

You should never edit anything inside the vendor directory. Composer is supposed to have 100% control over it. If you ever encounter an issue like this in the future (with any project), there are a few options.

The easiest is just to downgrade a version until it's resolved.

If there are no versions, try to install a specific branch.

You can fork the repo/package, fix the bug, and force Composer to use your forked version instead.

You could clone it locally If you only need to get by for a couple of days and are working locally. You would use the symbolic link method in Composer.