PHPackages                             jobmetric/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jobmetric/laravel-location

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jobmetric/laravel-location
==========================

This is a website location management package for Laravel that you can use in your projects.

2.1.0(2mo ago)7181MITPHPPHP &gt;=8.0.1CI passing

Since Jul 5Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/jobmetric/laravel-location)[ Packagist](https://packagist.org/packages/jobmetric/laravel-location)[ Docs](https://jobmetric.github.io/packages/laravel-location)[ RSS](/packages/jobmetric-laravel-location/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (12)Versions (10)Used By (1)

[![Contributors](https://camo.githubusercontent.com/c630145f212655d9b7defd70c65fe7adab512ae50cf2134de2889de1ae632934/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6a6f626d65747269632f6c61726176656c2d6c6f636174696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-location/graphs/contributors)[![Forks](https://camo.githubusercontent.com/6500553475b0f70ceaad479fb70cd29b0c178e1e0cd786e45b92e4699a7190d4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6a6f626d65747269632f6c61726176656c2d6c6f636174696f6e2e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d466f726b)](https://github.com/jobmetric/laravel-location/network/members)[![Stargazers](https://camo.githubusercontent.com/6f646052e3dfc32c4805c1868098563428321f51aaa9c1362143b1be65b7b5ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f626d65747269632f6c61726176656c2d6c6f636174696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-location/stargazers)[![MIT License](https://camo.githubusercontent.com/68a4e591c94e3c07a9f48e13e6926355f75cb99c6bc563c4597968d4e8ac7c18/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f626d65747269632f6c61726176656c2d6c6f636174696f6e2e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-location/blob/master/LICENCE.md)[![LinkedIn](https://camo.githubusercontent.com/eb590f47a3fca74584d18db8dd3e985ae3d786f50cd41b7530c3af3885da233c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c75652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e26636f6c6f72423d353535)](https://linkedin.com/in/majidmohammadian)

Laravel Location
================

[](#laravel-location)

**Location Management for Laravel. Structured. Scalable.**

Laravel Location helps you model and manage geographic data in a clean, consistent way—from Countries and Provinces to Cities, Districts, Locations, Geo Areas and Addresses. It is designed to be used as a reusable package in real-world Laravel applications where location data needs to be normalized and shared across multiple models.

Why Laravel Location?
---------------------

[](#why-laravel-location)

### A clean hierarchy: Country → Province → City → District

[](#a-clean-hierarchy-country--province--city--district)

Keep your geographical data normalized and queryable with a clear relational hierarchy. This makes reporting, filtering, and validation much easier across your application.

### Reusable Locations, Geo Areas and Addresses

[](#reusable-locations-geo-areas-and-addresses)

- **Locations** are stored as unique records (country/province/city/district combination).
- **Geo Areas** can reference multiple locations (non-duplicated).
- **Addresses** can be attached to any model (polymorphic) and are stored with a location relation.

### Service-first API + Facades

[](#service-first-api--facades)

Each entity is managed through a dedicated service and convenient Facades:

- `Country`, `Province`, `City`, `District`
- `Location`, `GeoArea`, `Address`

This keeps controllers thin and makes the package easy to integrate and test.

Quick Start
-----------

[](#quick-start)

Install via Composer:

```
composer require jobmetric/laravel-location
```

Run migrations:

```
php artisan migrate
```

Optionally publish config/translations (if you need to override defaults):

```
php artisan vendor:publish --provider="JobMetric\\Location\\LocationServiceProvider"
```

Usage (Examples)
----------------

[](#usage-examples)

Store a country using the Facade:

```
use JobMetric\Location\Facades\Country;

$response = Country::store([
    'name' => 'Iran',
    'flag' => 'iran.svg',
    'mobile_prefix' => 98,
    'validation' => [
        '/^9\\d{9}$/',
    ],
    'address_on_letter' => "{country}, {province}, {city}\n{district}, {street}, {number}",
    'status' => true,
]);
```

Attach address/geo areas to your models using traits:

```
use Illuminate\Database\Eloquent\Model;
use JobMetric\Location\HasAddress;
use JobMetric\Location\HasGeoArea;

class User extends Model
{
    use HasAddress;
}

class Shipping extends Model
{
    use HasGeoArea;
}
```

Documentation
-------------

[](#documentation)

Documentation for Laravel Location is available here:

**[📚 Read Full Documentation →](https://jobmetric.github.io/packages/laravel-location/)**

The documentation includes:

- **Getting Started** - Installation and configuration
- **Traits** - `HasAddress`, `HasGeoArea`, `HasLocation`
- **Services &amp; Facades** - Complete API reference
- **Requests &amp; Resources** - Validation and API responses
- **Events** - Hook into lifecycle events
- **Testing** - How to run package tests and expected patterns

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

[](#contributing)

Thank you for participating in `laravel-location`. A contribution guide can be found [here](CONTRIBUTING.md).

License
-------

[](#license)

The `laravel-location` is open-sourced software licensed under the MIT license. See [License File](LICENCE.md) for more information.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance88

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.4% 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 ~77 days

Recently: every ~109 days

Total

9

Last Release

60d ago

Major Versions

1.4.0 → 2.0.02026-02-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00d08bd4b0b765ee2d33719a535e6cb49c04fb945078a0809d5c05e6f16ee96?d=identicon)[majidmohammadian](/maintainers/majidmohammadian)

---

Top Contributors

[![MajidMohammadian](https://avatars.githubusercontent.com/u/2099965?v=4)](https://github.com/MajidMohammadian "MajidMohammadian (180 commits)")[![Bagheri-Matin](https://avatars.githubusercontent.com/u/239607447?v=4)](https://github.com/Bagheri-Matin "Bagheri-Matin (2 commits)")[![hassan7303](https://avatars.githubusercontent.com/u/128932029?v=4)](https://github.com/hassan7303 "hassan7303 (1 commits)")

---

Tags

citiescitycountriescountrygeo-zonelaravellaravel-locationslaravel-packagelocationpackageprovinceprovincesstrictlaraveladdresspackagelocationcountrycityprovincedistrictjobmetricgeo area

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[nevadskiy/laravel-geonames

Populate your database using the GeoNames service.

2715.1k](/packages/nevadskiy-laravel-geonames)

PHPackages © 2026

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