src/Language.php
public static function codes($langs)
    {
        // Get mode
        $mode = config('language.mode');

        // Get languages from config
        $languages = config('language.all');

        $array = [];

        // Generate an array with $lang as key and $lang code as value
        foreach ($langs as $lang) {
            $lang_code = 'unk';

            foreach ($languages as $language) {
                if ($language[$mode['name']] == $lang) {
                    $lang_code = $language[$mode['code']];
                }
            }

            $array[$lang] = $lang_code;
        }

        return $array;
    }
public static function codes($langs)
    {
        // Get mode
        $mode = config('language.mode');

        // Get languages from config
        $languages = config('language.all');

        $array = [];

        // Generate an array with $lang as key and $lang code as value
        foreach ($langs as $lang) {
            $lang_code = 'unk';

            foreach ($languages as $language) {
                if ($language[$mode['name']] == $lang) {
                    $lang_code = $language[$mode['code']];
                }
            }

            $array[$lang] = $lang_code;
        }

        return $array;
    }
Add names to an array of language codes as [$language => $code].

@param array $langs

@return array