mcamara / laravel-localization

Easy localization for Laravel
MIT License
3.38k stars 515 forks source link

LaravelLocalization::getCurrentLocale() should not be called statically #575

Closed NicolaeCasir closed 5 years ago

NicolaeCasir commented 6 years ago

Hello. I never used this plugin, but because now i have big problems with laravel default localization i choosed to use this one. Here is my problem: Non-static method Mcamara\LaravelLocalization\LaravelLocalization::getCurrentLocale() should not be called statically and code is: public function index () { $lang = LaravelLocalization::getCurrentLocale(); ... } PHP 7.2.6 (cli) Laravel 5.6.28

Thank you.

NBZ4live commented 6 years ago

You should call it statically only on the Facade, not the real class.

Just use \Mcamara\LaravelLocalization\Facades\LaravelLocalization or \LaravelLocalization

vicodeveloper commented 3 years ago

use \Mcamara\LaravelLocalization\Facades\LaravelLocalization work for me! Thx!