-
app/Traits/Helpers/AvailableLanguages.php
Open in GitHubtrait AvailableLanguages { // public function getAvailableLanguages($localize = false): array { return collect($this->getFilesystemInstance()->directories(resource_path('lang')))->mapWithKeys(function ($path) use ($localize) { $code = basename($path); $value = $localize ? $this->getIsoInstance()->nativeByCode1($code) : $this->getIsoInstance()->languageByCode1($code); return [$code => title_case($value)]; })->toArray(); } // }