{"id":15287389,"url":"https://github.com/oselya/ip-geolocation-bundle","last_synced_at":"2025-09-07T17:45:42.814Z","repository":{"id":62549384,"uuid":"484663617","full_name":"oselya/ip-geolocation-bundle","owner":"oselya","description":"Symfony IP geolocation bundle","archived":false,"fork":false,"pushed_at":"2024-07-15T12:25:13.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T05:08:46.963Z","etag":null,"topics":["geolocation","ip","ipapi","ipv4","ipv6","maxmind","symfony-bundle"],"latest_commit_sha":null,"homepage":"","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/oselya.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":"2022-04-23T06:11:46.000Z","updated_at":"2024-07-15T08:17:00.000Z","dependencies_parsed_at":"2024-10-14T18:21:12.890Z","dependency_job_id":null,"html_url":"https://github.com/oselya/ip-geolocation-bundle","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselya%2Fip-geolocation-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselya%2Fip-geolocation-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselya%2Fip-geolocation-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oselya%2Fip-geolocation-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oselya","download_url":"https://codeload.github.com/oselya/ip-geolocation-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665747,"owners_count":21142123,"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":["geolocation","ip","ipapi","ipv4","ipv6","maxmind","symfony-bundle"],"created_at":"2024-09-30T15:28:00.589Z","updated_at":"2025-04-13T05:08:59.684Z","avatar_url":"https://github.com/oselya.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Symfony IP geolocation bundle\n=============================\n[![License][license-image]][license-link] ![workflow](https://github.com/oselya/ip-geolocation-bundle/actions/workflows/php.yml/badge.svg)\n\nInstall\n\n```shell\ncomposer req oselya/ip-geolocation-bundle\n```\n\nBefore we get started, there is a small amount of configuration needed\n\n```yml\n# app/config/ip_geolocation.yaml\n\nip_geolocation:\n  cache_ttl: -1\n  maxmind:\n    city_path: 'GeoLite2-City.mmdb'\n  ip_api_com:\n    access_key: 'qwerty'\n```\n\nCli command\n\n```shell\n$ bin/console app:ip:location 92.253.204.162\n+----------------+-----------+---------+-----------------+-----------------+\n| IP             | Continent | Country | Latitude        | Longitude       |\n+----------------+-----------+---------+-----------------+-----------------+\n| 92.253.204.162 | EU        | UA      | 48.342449188232 | 24.575370788574 |\n+----------------+-----------+---------+-----------------+-----------------+\n```\n\nService\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace Oselya\\IpGeolocationBundle\\Command;\n\nuse Oselya\\IpGeolocationBundle\\GeoIpProvider\\GeoIpProviderInterface;\nuse Oselya\\IpGeolocationBundle\\ValueObject\\Ip;\nuse Symfony\\Component\\Console\\Command\\Command;\nuse Symfony\\Component\\Console\\Helper\\Table;\nuse Symfony\\Component\\Console\\Input\\InputArgument;\nuse Symfony\\Component\\Console\\Input\\InputInterface;\nuse Symfony\\Component\\Console\\Output\\OutputInterface;\n\nclass IpGeolocationCommand extends Command\n{\n    public function __construct(private readonly GeoIpProviderInterface $provider)\n    {\n        parent::__construct();\n    }\n\n    protected function configure(): void\n    {\n        $this\n            -\u003esetName('app:ip:location')\n            -\u003eaddArgument('ip', InputArgument::REQUIRED, 'The IP address.')\n            -\u003esetDescription('This command allows you to lookup location of IP addresses.');\n    }\n\n    protected function execute(InputInterface $input, OutputInterface $output): int\n    {\n        $location = $this-\u003eprovider-\u003eipLookup(new Ip($input-\u003egetArgument('ip')));\n\n        $table = new Table($output);\n        $table\n            -\u003esetHeaders(['IP', 'Continent', 'Country', 'Latitude', 'Longitude'])\n            -\u003esetRows([\n                [\n                    $input-\u003egetArgument('ip'),\n                    $location-\u003egetContinent(),\n                    $location-\u003egetCountry(),\n                    $location-\u003egetLatitude(),\n                    $location-\u003egetLongitude(),\n                ],\n            ]);\n        $table-\u003erender();\n\n        return Command::SUCCESS;\n    }\n}\n```\n\n[license-link]: https://github.com/oselya/ip-geolocation-bundle/blob/main/LICENSE\n[license-image]: https://img.shields.io/dub/l/vibe-d.svg","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foselya%2Fip-geolocation-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foselya%2Fip-geolocation-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foselya%2Fip-geolocation-bundle/lists"}