{"id":37002898,"url":"https://github.com/netcore/module-country","last_synced_at":"2026-01-14T00:31:02.993Z","repository":{"id":57025404,"uuid":"120667720","full_name":"netcore/module-country","owner":"netcore","description":"Module that provides helper methods to work with lists of countries and currencies","archived":false,"fork":false,"pushed_at":"2018-06-07T10:11:38.000Z","size":585,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-11T21:55:09.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/netcore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-07T20:28:56.000Z","updated_at":"2018-06-07T10:11:24.000Z","dependencies_parsed_at":"2022-08-23T16:11:05.182Z","dependency_job_id":null,"html_url":"https://github.com/netcore/module-country","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/netcore/module-country","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-country","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-country/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-country/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-country/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netcore","download_url":"https://codeload.github.com/netcore/module-country/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-country/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T00:31:02.294Z","updated_at":"2026-01-14T00:31:02.932Z","avatar_url":"https://github.com/netcore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\nThis module provides helper methods to work with lists of countries and currencies\n\n## Pre-installation\nThis package is part of Netcore CMS ecosystem and is only functional in a project that has the following packages\ninstalled:\n\n1. https://github.com/netcore/netcore\n\n### Installation\n\n* Require this package using composer\n```\ncomposer require netcore/module-country\n```\n\n* Publish configuration, migrations and assets\n```\nphp artisan module:publish-config Country\nphp artisan module:publish-migration Country\nphp artisan module:publish Country\nphp artisan migrate\n```\n\n* Seed the configuration to database\n```\nphp artisan module:seed Country\n```\n\n## Usage\n\n* Get all countries:\n```php\ncountry()-\u003eall();\n```\n\n* Find a country by its `ISO 3166-2` code:\n```php\n$country = country()-\u003efindByCode('SE');\n$country-\u003ecode; // SE\n$country-\u003ename; // Sweden\n$country-\u003ecapital; // Stockholm\n$country-\u003efull_name; // Kingdom of Sweden\n$country-\u003ecalling_code; // 46\n$country-\u003eeea; // true\n$country-\u003eflag_url; // Will return asset URL to the country flag\n```\n\n* Get all countries as a collection for select lists (will return a collection in this format - ID =\u003e Country name)\n```php\ncountry()-\u003egetSelectList();\n```\n\nYou can also attach a country or a currency to any model:\n```php\npublic function country(): Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\n{\n    return $this-\u003ebelongsTo(Modules\\Country\\Models\\Country::class);\n}\n```\n\n```php\npublic function currency(): Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\n{\n    return $this-\u003ebelongsTo(Modules\\Country\\Models\\Currency::class);\n}\n```\n\n## Disclaimer\nWe take no responsibility for the accuracy of the country, currency and flag lists provided in the source files. The \nlists were made diregarding any political and religious views. If you find the country list inaccurate, feel free to fork\nthe repository and change the lists how you wish.\n\n## Todo:\n* Add unit tests\n* Make countries and currencies manageable in the admin panel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcore%2Fmodule-country","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetcore%2Fmodule-country","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcore%2Fmodule-country/lists"}