PHPackages                             codeblog.pro/laravel-geo-location - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. codeblog.pro/laravel-geo-location

ActiveLibrary[API Development](/categories/api)

codeblog.pro/laravel-geo-location
=================================

The package allows you to get the location of the user by his IP. The package provides the ability to use several services at the same time to increase accuracy and to increase free limits.

v0.1.2(5y ago)054[3 PRs](https://github.com/PanovAlexey/geo-location/pulls)Apache-2.0PHPPHP &gt;=7.4

Since Aug 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/PanovAlexey/geo-location)[ Packagist](https://packagist.org/packages/codeblog.pro/laravel-geo-location)[ Docs](https://github.com/PanovAlexey/geo-location)[ RSS](/packages/codeblogpro-laravel-geo-location/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (10)Versions (14)Used By (0)

Geo location service package
============================

[](#geo-location-service-package)

[![Build Status](https://camo.githubusercontent.com/7a0811e394b5121d9098dc0d96110ffa7a5329d6df2d5f69ba78b58533fa1e55/68747470733a2f2f7472617669732d63692e6f72672f50616e6f76416c657865792f67656f2d6c6f636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PanovAlexey/geo-location)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9a304c20089b8ed5799820e2e6b48697ceb1962f8e8e4fb65d135cc7e0538148/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50616e6f76416c657865792f67656f2d6c6f636174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/PanovAlexey/geo-location/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/72068f65eb0303d4401a031e6e601458d8ca48eb3ce52e7a53e2435e61360d08/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50616e6f76416c657865792f67656f2d6c6f636174696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/PanovAlexey/geo-location/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/2501fe235dd242fe862755fa0483e1c23cd8f86ecf9aa1041fedc40f22cb008e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f50616e6f76416c657865792f67656f2d6c6f636174696f6e2f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Total Downloads](https://camo.githubusercontent.com/3225994e18daf5335800f968b4e87623a22fddb3008c8a64586d52df869fd500/68747470733a2f2f706f7365722e707567782e6f72672f636f6465626c6f672e70726f2f67656f2d6c6f636174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/codeblog.pro/geo-location)[![Version](https://camo.githubusercontent.com/7465778fe36ed950122977177d0d92cc26c0ff9ddee974d2cd05ee0173c11ef9/68747470733a2f2f706f7365722e707567782e6f72672f636f6465626c6f672e70726f2f67656f2d6c6f636174696f6e2f76657273696f6e)](https://packagist.org/packages/codeblog.pro/geo-location)

The package is a wrapper for several geolocation services at once. The main task of the package is to determine the user's location by IP. Due to the possibility of using several providers at once, the free limit of each provider is summed up.

Install
-------

[](#install)

Via Composer

```
$ composer require codeblog.pro/geo-location
```

Usage
-----

[](#usage)

```
// First way: in code
$geoLocationService = new \CodeblogPro\GeoLocation\Application\Services\GeoLocationService();
$location = $geoLocationService->getLocationByIpAndLanguageResultCode('8.8.8.8', 'EN');
var_dump($location);

$locationArray = $geoLocationService->getLocationArrayByIpAndLanguageResultCode('8.8.8.8', 'RU');
var_dump($locationArray);

$currentIpResolver = new \CodeblogPro\GeoLocation\Application\Services\CurrentIpResolver();
$currentIp = $geoLocationService->getCurrentIpByIpResolver($currentIpResolver)->getValue();
var_dump($currentIp);

$locationByIpResolverAndLanguageResultCode = $geoLocationService->getLocationByIpResolverAndLanguageResultCode(
    $currentIpResolver,
    'RU'
);
var_dump($locationByIpResolverAndLanguageResultCode);

// Second way (only for Laravel): using a GET request,
// for example by url http:///api/geo-location/46.174.50.30/en
// Result:
// {
//   "data":{
//     "latitude":55.07944,
//     "longitude":38.77833,
//     "country_name":"Russia",
//     "country_code":"RU",
//     "region_name":"Moskovskaya Oblast'",
//     "region_code":"RU-MOS",
//     "street_name":"",
//     "postal_code":"1404xx",
//     "locality":"Kolomna"
//   }
// }
```

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Panov Alexey](https://www.linkedin.com/in/codeblog/)

License
-------

[](#license)

The Apache License License. Please see [License File](LICENSE) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

10

Last Release

2096d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/320ebec2f4777f2dbb62ce4ddee6529a950a7a2d9ed4ab2d31c0660b35b3de63?d=identicon)[Panov Alexey](/maintainers/Panov%20Alexey)

---

Top Contributors

[![PanovAlexey](https://avatars.githubusercontent.com/u/15037622?v=4)](https://github.com/PanovAlexey "PanovAlexey (94 commits)")

---

Tags

apiwrappergeocoordinatesgeo-locationgeographical-coordinates

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/codeblogpro-laravel-geo-location/health.svg)

```
[![Health](https://phpackages.com/badges/codeblogpro-laravel-geo-location/health.svg)](https://phpackages.com/packages/codeblogpro-laravel-geo-location)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
