vendredi 9 décembre 2016

how can i detect language in laravel 5.1 api for validation error?

I have a api in laravel and I want return validation errors in user's language. how can I specify language in laravel api? for example response this :

 if ($validator->fails()) {
            return response()->json([
                'errors' => $validator->getMessageBag()->getMessages(),
            ], 400);
        }

return best for each language. fa and en.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire