I have an almost fresh installation of Lumen.
I have a POST route which leads to one Controller. In the request I send lang parameter with
Changing locale at the runtime varying depends on the framework. You can use facade or helper function:
For Lumen:
Lang::setLocale('lang');
or
app('translator')->setLocale('lang');
For Laravel:
App::setLocale('lang');
or
app()->setLocale('lang');
You are changing the config after it is loaded, which has no effect. To change the locale at runtime use the setLocale() method on the app instance:
app()->setLocale($request->input('lang'));
The first answer seem to only work on Laravel. To change the locale at runtime with Lumen use this:
app('translator')->setLocale($request->input('lang'));