Reputation: 1513
I am using laravel 6 and need to separate en.json for admin and front end because of some reason
Upvotes: 0
Views: 2027
Reputation: 231
You better don't use the Using Translation Strings As Keys
for this purpose. But if you want to.. do the following:
Create in resources/lang/
a folder named admin
and put en.json
in it. Then add in your middleware, controller or whatever you like:
Lang::setLocale('admin/en');
In your template you can now refer with @lang('areyou')
to translate.
Upvotes: 2