langPath = resource_path('lang/'.App::getLocale()); } /** * Bootstrap the application services. * * @return void */ public function boot() { Cache::rememberForever('translations', function () { return collect(File::allFiles($this->langPath))->flatMap(function ($file) { return [ ($translation = $file->getBasename('.php')) => trans($translation), ]; })->toJson(); }); } }