public static function getCountriesContacts($args) { return Country::join('001_001_lang', '001_002_country.lang_id_002', '=', '001_001_lang.id_001')->where('lang_id_002', $args['lang'])->whereIn('id_002', function ($query) { $query->select('country_id_041')->from('005_041_contact')->groupBy('country_id_041')->get(); })->orderBy('name_002')->get(); }