{"id":24531493,"url":"https://github.com/hamedhaghi/countries-client","last_synced_at":"2026-02-04T15:40:11.245Z","repository":{"id":265961669,"uuid":"895568991","full_name":"hamedhaghi/countries-client","owner":"hamedhaghi","description":"The REST Countries API client for PHP.","archived":false,"fork":false,"pushed_at":"2024-12-21T17:35:58.000Z","size":125,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T19:12:52.047Z","etag":null,"topics":["composer","package","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/hamedhaghi/countries","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/hamedhaghi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-28T13:03:01.000Z","updated_at":"2025-01-11T19:12:49.000Z","dependencies_parsed_at":"2024-12-19T15:35:49.629Z","dependency_job_id":"d92b1afe-4994-42fd-85b1-0cad199192aa","html_url":"https://github.com/hamedhaghi/countries-client","commit_stats":null,"previous_names":["hamedhaghi/countries-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamedhaghi%2Fcountries-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamedhaghi%2Fcountries-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamedhaghi%2Fcountries-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamedhaghi%2Fcountries-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamedhaghi","download_url":"https://codeload.github.com/hamedhaghi/countries-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248943461,"owners_count":21186958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["composer","package","php"],"created_at":"2025-01-22T09:15:07.998Z","updated_at":"2026-02-04T15:40:06.200Z","avatar_url":"https://github.com/hamedhaghi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Countries PHP Client\n\nA PHP client for the [RestCountries API](https://restcountries.com/). This package simplifies interacting with the API by providing an object-oriented interface to retrieve country data.\n\n## Features\n\n- Fetch detailed information about countries.\n- Support for caching to improve performance.\n- Compatible with both legacy and modern PHP projects.\n\n## Requirements\n\n- PHP 7.0 or higher\n\n## Installation\n\nInstall the package via Composer:\n\n```bash\ncomposer require hamedhaghi/countries\n```\n\n## Usage Example\n\n```php\nrequire_once 'vendor/autoload.php';\n\nuse Hamed\\Countries\\Factory\\CountryRepositoryFactory;\n\n// Initialize the client\n$factory = new CountryRepositoryFactory();\n\n// Enable caching for faster responses (optional)\n$factory = $factory-\u003eisCachable()\n                   -\u003esetCacheTTL(3600); // Cache expiration time in seconds\n\n// Initialize the repository\n$repository = $factory-\u003einit();\n\n// Query country data\n$countries = $repository-\u003egetAll();\n$countries = $repository-\u003egetByCapital('Berlin');\n$countries = $repository-\u003egetByCode('DE');\n$countries = $repository-\u003egetByCurrency('euro');\n$countries = $repository-\u003egetByDemonym('German');\n$countries = $repository-\u003egetByFullName('Germany');\n$countries = $repository-\u003egetByLanguage('German');\n$countries = $repository-\u003egetByName('Germany');\n$countries = $repository-\u003egetByRegion('Europe');\n$countries = $repository-\u003egetBySubregion('Western Europe');\n$countries = $repository-\u003egetByTranslation('Germany');\n\n// Clear the cache\n$factory-\u003eclearCache();\n\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request with your changes.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamedhaghi%2Fcountries-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamedhaghi%2Fcountries-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamedhaghi%2Fcountries-client/lists"}