PHPackages                             shiveh/mapir - 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. shiveh/mapir

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

shiveh/mapir
============

Offcial Map.ir Laravel package

v1.1.1(6y ago)42.3k3[1 issues](https://github.com/map-ir/laravel-package/issues)[1 PRs](https://github.com/map-ir/laravel-package/pulls)MITPHPCI failing

Since Jul 13Pushed 3y agoCompare

[ Source](https://github.com/map-ir/laravel-package)[ Packagist](https://packagist.org/packages/shiveh/mapir)[ RSS](/packages/shiveh-mapir/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

[![](https://camo.githubusercontent.com/c0d10812c9cb451ca67bb1986722a851b16be855f9bd077044d1706351c651b4/68747470733a2f2f737570706f72742e6d61702e69722f77702d636f6e74656e742f75706c6f6164732f323031392f30332f736974652d6c6f676f2e706e67)](https://camo.githubusercontent.com/c0d10812c9cb451ca67bb1986722a851b16be855f9bd077044d1706351c651b4/68747470733a2f2f737570706f72742e6d61702e69722f77702d636f6e74656e742f75706c6f6164732f323031392f30332f736974652d6c6f676f2e706e67)

Official Laravel Package for map.ir

[![Latest Stable Version](https://camo.githubusercontent.com/cb356ace74cce6336be04c4c880fe09ac6bab22dafebef9ead88f99a4e01cc72/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f762f737461626c65)](https://packagist.org/packages/shiveh/mapir)[![Total Downloads](https://camo.githubusercontent.com/bdfd7865cce802c127a2b9497bc1a2e716798ca808537be204107dfab9c6ba62/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f646f776e6c6f616473)](https://packagist.org/packages/shiveh/mapir)[![License](https://camo.githubusercontent.com/08288d41a78042c0fcdb755db24fbba454a9cedb13433807050d2260a324cc7d/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f6c6963656e7365)](https://packagist.org/packages/shiveh/mapir)[![Monthly Downloads](https://camo.githubusercontent.com/e93121964a98e37a2e29456b548fbf9cbead4ee7a7b274eff2b6196c07dfde73/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f642f6d6f6e74686c79)](https://packagist.org/packages/shiveh/mapir)[![Daily Downloads](https://camo.githubusercontent.com/443a3ea54feb3ec31338b90f05a68d4f9e3ecc87d89a5452493a7dfe4e52ad8c/68747470733a2f2f706f7365722e707567782e6f72672f7368697665682f6d617069722f642f6461696c79)](https://packagist.org/packages/shiveh/mapir)[Service Documentation ](https://corp.map.ir)

Hi, if you have an account in map.ir, you can use this package for laravel

How to install:
---------------

[](#how-to-install)

```
 composer require shiveh/mapir
 php artisan vendor:publish --tag=mapir

```

> **Setup:**

> Laravel Installation

add this line to your app.php providers:

```
 Shiveh\Mapir\MapirLaravelServiceProvider::class,

```

and add this line to your app.php aliases:

```
'Mapir' => Shiveh\Mapir\MapirLaravelFacade::class,

```

After publish the package files you must open mapir.php in config folder and set the api-key.

> **Like this:**

```
'webservice-url' => env('MAPIR_WEBSERVICE_URL','https://map.ir'),
'api-key' => env('MAPIR_API_KEY','Your map.ir api key'),

```

> Lumen Installation

add package service provider in bootstrap/app.php.

```
$app->register(Shiveh\Mapir\MapirLaravelServiceProvider::class);
class_alias(Shiveh\Mapir\MapirLaravelFacade::class, 'Mapir');

```

copy package config directory `vendor/shiveh/mapir/config` to root folder alongside with app directory.

update bootstrap/app.php by adding this line in `Register Config Files` section:

```
$app->configure('mapir');

```

Making Lumen work with facades by uncommenting this line in bootstrap/app.php.

```
$app->withFacades();

```

> ### Note:
>
> [](#note)

you can set the keys in your .env file

> **like this:**

```
 MAPIR_WEBSERVICE_URL=https://map.ir

 MAPIR_API_KEY=your api-key

```

Methods:
--------

[](#methods)

> Mapir::search():

```
  \Mapir::search(
          'ساوجینیا',
          Select::POI,
          Filter::distance('20km'),
          [
              "type"=> "Point",
              "coordinates"=> [
                  51.3361930847168,
                  35.7006311416626
              ]
          ]
      );

```

The search method has four arguments.

> Text(Required):

This argument is used as a text, which you want to find it's location on map. for example (ساوجینیا)

> Select(Optional):

Inorder to apply your search request on specific group of entities.

```
 Select :: POI

```

> To select each of these land effects, first write "Select::" and then the name of the land effects according to the following table:

IDEntitiesDescriptionExample1POIThe search is on places recorded on the map.Select::POI2PROVINCEThe search is on provinces.Select::PROVINCE3CITYThe search is on cities.Select::CITY4COUNTYThe search is on counties.Select::COUNTY5DISTRICTThe search is on districts.Select::DISTRICT6NEIGHBORHOODThe search is on neighborhoods.Select::NEIGHBORHOOD7LANDUSEThe search is on landuse.Select::LANDUSE8WOODWATERThe search is on Natural resources (For example mountains, forests etc).Select::WOODWATER9ROADSThe search is on roads .Select::ROADS10multiLandEffectTo select a few itemsSelect::multiLandEffect(\[Select::POI,Select::ROADS\])> Filter(Optional):

To filter search results, for example, get results only in Tehran.

```
Filter :: city ('تهران')

```

> More filter features:

IDMethodsDescriptionExample1cityFilter by cityFilter::city('تهران')2countyFilter by countyFilter::county('رباط کریم')3districtFilter by districtFilter::district('درکه')4neighborhoodFilter by neighborhoodFilter::neighborhood('عباس آباد')5distanceFilter by distance for example 20m or 20kmFilter::distance('20m')6provinceFilter by provinceFilter::province('کردستان')> Geographic coordinates(Required):

Use this format for coordinates, inorder to get better result. look for other possible formats in this site [geojson.io](http://geojson.io/).

```
[
  "type"=> "Point",
  "coordinates"=> [
             51.3361930847168,
             35.7006311416626
    ]
]

```

> Mapir::searchAutocomplete()

```
\Mapir::searchAutocomplete(
        'ساوجی',
        Select::POI,
        Filter::distance('20km'),
        [
            "type"=> "Point",
            "coordinates"=> [
                51.3361930847168,
                35.7006311416626
            ]
        ]
    );

```

The search differs with the search (live search) in the concept of the structure of the search words. When using a normal search, the search algorithm looks for addresses that are exactly the same as the text of the input, while the live search matches some of the information entered with the existing data and suggests the closest and most likely results.

> Mapir::reverse()

```
   \Mapir::reverse(35.732634, 51.422571);

```

The reverse is the conversion of geographic coordinates to text addresses

> Mapir::fastReverse()

```
   \Mapir::fastReverse(35.732634, 51.422571);

```

The difference between these two different types of addressing is in detail and the response speed. In full mode, along with the details of the address, if the coordinates of the location are registered on the map, the registered place name is also returned in the response, while in the fast state of this feature does not exist. The main advantage of fast addressing is its speed, so that its response time is about 20ms, while in a full-time matching mode, this is about 70ms.

License
-------

[](#license)

![FOSSA Status]()

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~161 days

Total

3

Last Release

2221d ago

### Community

Maintainers

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

---

Top Contributors

[![arminnasiri](https://avatars.githubusercontent.com/u/38916326?v=4)](https://github.com/arminnasiri "arminnasiri (3 commits)")[![hamedzarei](https://avatars.githubusercontent.com/u/22744130?v=4)](https://github.com/hamedzarei "hamedzarei (3 commits)")[![alirezashm](https://avatars.githubusercontent.com/u/64735254?v=4)](https://github.com/alirezashm "alirezashm (2 commits)")[![MoHADev](https://avatars.githubusercontent.com/u/33175366?v=4)](https://github.com/MoHADev "MoHADev (1 commits)")

---

Tags

composerlaravelphplaravelmapgeompنقشهmap.ir

### Embed Badge

![Health badge](/badges/shiveh-mapir/health.svg)

```
[![Health](https://phpackages.com/badges/shiveh-mapir/health.svg)](https://phpackages.com/packages/shiveh-mapir)
```

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.2M84](/packages/stevebauman-location)[spatie/geocoder

Geocoding addresses to coordinates

8425.0M19](/packages/spatie-geocoder)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

42010.0k](/packages/venturedrake-laravel-crm)[firefly-iii/data-importer

Firefly III Data Import Tool.

8005.8k](/packages/firefly-iii-data-importer)[nickurt/laravel-akismet

Akismet for Laravel 11.x/12.x/13.x

98145.2k3](/packages/nickurt-laravel-akismet)[eseath/sypexgeo

A PHP package for working with the SypexGeo database file.

12184.0k](/packages/eseath-sypexgeo)

PHPackages © 2026

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