Search code examples
laravellaravel-5.6laravel-localization

How to get localization array values from sub folder?


I have sample file structure in my app: Folders:

lang->en->admin

Here I have sample localization file:

menu.php

Code in file:

<?php
return [
    'home' => 'Admin Dashboard',
];

How I can get home key value in blade?

I now tested this example code but not work:

{{__(admin/menu.home)}}
{{__(admin\menu.home)}}

Solution

  • In your views change this to

    {{__(admin/menu.home)}}
    {{__(admin\menu.home)}}
    

    This

    {{__('admin/menu.home')}}
    {{__('admin\menu.home')}}