de; } if($lang == 'en'){ return $this->en; } if($lang == 'es'){ return $this->es; } if($lang == 'fr'){ return $this->fr; } if($lang == 'it'){ return $this->it; } if($lang == 'ru'){ return $this->ru; } return $this->de; } public static function getCountryIdByCode($code){ if($code == null){ return null; } $r = Country::where('code', '=', $code)->first(); if($r){ return $r->id; } return null; } public static function getCountryIdByPhone($phone){ if($phone == null){ return null; } $r = Country::where('phone', '=', $phone)->first(); if($r){ return $r->id; } return null; } }