Aug 23, 2017 · 1 min read
Great article, so creative. I am going to use your idea, but I will create a javascript.php file so it only loads those translations for javascript, changing this line:
$files = glob(resource_path(‘lang/’ . $lang . ‘/javascript.php’));
Also in development it is easier to use Cache::forget(‘lang.js’); just before the rememberForever, so it is not needed to refresh cache every time you add a single line.
Thanks!