hpmhpm's avatar

Lumen 5.3: Custom translation strings in validation

I created a simple test for validation:

    $v = app('validator')->make(['xLog' => ''], ['xLog' => 'required']);
    $v->passes();
    print_r($v->errors()->all());

And the result is:

Array ( [0] => validation.required )

Now I see basic translations are not loaded, is there any configuration for them in lumen?

0 likes
1 reply
hpmhpm's avatar

In my case APP_LOCALE in .env file did not work, I had to add following line in boostrap file:

$app['translator']->setLocale(env('APP_LOCALE', 'en'));
2 likes

Please or to participate in this conversation.