src/models/HCMultiLanguageModel.php
public static function translatedList(string $nameKey = "name")
    {
        return (new static())->with('translations')->get()->map(function ($item, $key) use ($nameKey) {
            return [
                'id'    => $item->id,
                'label' => get_translation_name(
                    $nameKey, app()->getLocale(), array_get($item, 'translations')
                ),
            ];
        });
    }
public static function translatedList(string $nameKey = "name")
    {
        return (new static())->with('translations')->get()->map(function ($item, $key) use ($nameKey) {
            return [
                'id'    => $item->id,
                'label' => get_translation_name(
                    $nameKey, app()->getLocale(), array_get($item, 'translations')
                ),
            ];
        });
    }
public static function translatedList ( string $ nameKey = "name" ) { return ( new static ( ) ) -> with ( 'translations' ) -> get ( ) -> map ( function ( $ item , $ key ) use ( $ nameKey ) { return [ 'id' => $ item -> id , 'label' => get_translation_name ( $ nameKey , app ( ) -> getLocale ( ) , array_get ( $ item , 'translations' ) ) , ] ; } ) ; }
Get translated id -> value names

@param string $nameKey
@return mixed
Get translated id - > value names