{"id":18909839,"url":"https://github.com/map-ir/laravel-package","last_synced_at":"2025-10-03T13:19:35.072Z","repository":{"id":57049598,"uuid":"196682475","full_name":"map-ir/laravel-package","owner":"map-ir","description":"composer package for laravel \u0026 lumen","archived":false,"fork":false,"pushed_at":"2022-11-05T12:59:15.000Z","size":18,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-28T17:06:40.173Z","etag":null,"topics":["composer","laravel","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/map-ir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-13T05:31:05.000Z","updated_at":"2023-09-30T12:01:00.000Z","dependencies_parsed_at":"2023-01-21T02:03:43.110Z","dependency_job_id":null,"html_url":"https://github.com/map-ir/laravel-package","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/map-ir%2Flaravel-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/map-ir%2Flaravel-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/map-ir%2Flaravel-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/map-ir%2Flaravel-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/map-ir","download_url":"https://codeload.github.com/map-ir/laravel-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249020643,"owners_count":21199591,"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","laravel","php"],"created_at":"2024-11-08T09:35:22.025Z","updated_at":"2025-10-03T13:19:34.988Z","avatar_url":"https://github.com/map-ir.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://support.map.ir/wp-content/uploads/2019/03/site-logo.png\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eOfficial Laravel Package for map.ir\u003c/p\u003e\n\n[![Latest Stable Version](https://poser.pugx.org/shiveh/mapir/v/stable)](https://packagist.org/packages/shiveh/mapir)\n[![Total Downloads](https://poser.pugx.org/shiveh/mapir/downloads)](https://packagist.org/packages/shiveh/mapir)\n[![License](https://poser.pugx.org/shiveh/mapir/license)](https://packagist.org/packages/shiveh/mapir)\n[![Monthly Downloads](https://poser.pugx.org/shiveh/mapir/d/monthly)](https://packagist.org/packages/shiveh/mapir)\n[![Daily Downloads](https://poser.pugx.org/shiveh/mapir/d/daily)](https://packagist.org/packages/shiveh/mapir)\n\u003ca align=\"center\" href=\"https://corp.map.ir\"\u003eService Documentation \u003c/a\u003e\n\n\n\nHi, if you have an account in map.ir, you can use this package for laravel\n\nHow to install:\n----\n   ```\n    composer require shiveh/mapir \n    php artisan vendor:publish --tag=mapir\n  ```\n\n\u003e **Setup:**\n\u003e\n\n\u003eLaravel Installation\n\u003e\n add this line to your app.php providers:\n ~~~\n  Shiveh\\Mapir\\MapirLaravelServiceProvider::class,\n ~~~\n and add this line to your app.php aliases:\n ~~~ \n 'Mapir' =\u003e Shiveh\\Mapir\\MapirLaravelFacade::class,\n~~~\nAfter publish the package files you must open mapir.php in config folder and set the api-key.\n\n\u003e **Like this:**\n\n\t'webservice-url' =\u003e env('MAPIR_WEBSERVICE_URL','https://map.ir'),\n\t'api-key' =\u003e env('MAPIR_API_KEY','Your map.ir api key'),\n\u003e \n\u003eLumen Installation\n \u003e\n add package service provider in bootstrap/app.php.\n ~~~\n $app-\u003eregister(Shiveh\\Mapir\\MapirLaravelServiceProvider::class);\n class_alias(Shiveh\\Mapir\\MapirLaravelFacade::class, 'Mapir');\n ~~~\n copy package config directory `vendor/shiveh/mapir/config` to root folder alongside with app directory.\n \n update bootstrap/app.php by adding this line in `Register Config Files` section:\n  ~~~\n  $app-\u003econfigure('mapir');\n  ~~~\n \n Making Lumen work with facades by uncommenting this line in bootstrap/app.php.\n ~~~\n $app-\u003ewithFacades();\n ~~~\n\u003e### Note:\n\u003e\nyou can set the keys  in your .env file\n\n\u003e **like this:**\n~~~\n MAPIR_WEBSERVICE_URL=https://map.ir\n\n MAPIR_API_KEY=your api-key\n~~~\n\n\n\nMethods:\n-------------\n\n\u003eMapir::search():\n ~~~\n   \\Mapir::search(\n           'ساوجینیا',\n           Select::POI,\n           Filter::distance('20km'),\n           [\n               \"type\"=\u003e \"Point\",\n               \"coordinates\"=\u003e [\n                   51.3361930847168,\n                   35.7006311416626\n               ]\n           ]\n       );\n ~~~\n The search method has four arguments.\n \n  \u003eText(Required):\n  \u003e\n  This argument is used as a text, which you want to find it's location on map. for example (ساوجینیا)\n\u003eSelect(Optional):\n\u003e\n Inorder to apply your search request on specific group of entities.\n~~~\n Select :: POI\n ~~~\n \u003eTo select each of these land effects, first write \"Select::\" and then the name of the land effects according to the following table:\n \u003e\n | ID | Entities        | Description                                                              | Example                            |\n |----|-----------------|--------------------------------------------------------------------------|------------------------------------|\n | 1  | POI             | The search is on places recorded on the map.                  | Select::POI                        |\n | 2  | PROVINCE        | The search is on provinces.                                               | Select::PROVINCE                   |\n | 3  | CITY            | The search is on cities.                                                   | Select::CITY                       |\n | 4  | COUNTY          | The search is on counties.                                                 | Select::COUNTY                     |\n | 5  | DISTRICT        | The search is on districts.                                               | Select::DISTRICT                   |\n | 6  | NEIGHBORHOOD    | The search is on neighborhoods.                                           | Select::NEIGHBORHOOD               |\n | 7  | LANDUSE         | The search is on landuse.                                                | Select::LANDUSE                    |\n | 8  | WOODWATER       | The search is on Natural resources (For example mountains, forests etc). | Select::WOODWATER                  |\n | 9  | ROADS           | The search is on roads .                                                 | Select::ROADS                      |\n | 10 | multiLandEffect | To select a few items |                                  Select::multiLandEffect([Select::POI,Select::ROADS]) |\n\n \u003eFilter(Optional):\n \u003e\n  To filter search results, for example, get results only in Tehran.\n ~~~\n Filter :: city ('تهران')\n ~~~\n \u003eMore filter features:\n \u003e\n | ID | Methods      | Description                                | Example                     |\n |----|--------------|--------------------------------------------|-----------------------------|\n | 1  | city         | Filter by city                             | Filter::city('تهران')       |\n | 2  | county       | Filter by county                           | Filter::county('رباط کریم') |\n | 3  | district     | Filter by district                         | Filter::district('درکه')    |\n | 4  | neighborhood | Filter by neighborhood                     | Filter::neighborhood('عباس آباد')    |\n | 5  | distance     | Filter by distance for example 20m or 20km | Filter::distance('20m')     |\n | 6  | province     | Filter by province                         | Filter::province('کردستان') |\n \u003e Geographic coordinates(Required):\n \u003e\n Use this format for coordinates, inorder to get better result. \n look for other possible formats in this site [geojson.io](http://geojson.io/).\n~~~\n[\n  \"type\"=\u003e \"Point\",\n  \"coordinates\"=\u003e [\n             51.3361930847168,\n             35.7006311416626\n    ]\n]\n~~~ \n \n\u003e Mapir::searchAutocomplete()\n~~~\n\\Mapir::searchAutocomplete(\n        'ساوجی',  \n        Select::POI,\n        Filter::distance('20km'),\n        [\n            \"type\"=\u003e \"Point\",\n            \"coordinates\"=\u003e [\n                51.3361930847168,\n                35.7006311416626\n            ]\n        ]\n    );\n~~~\nThe 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.\n\u003e Mapir::reverse()\n~~~\n   \\Mapir::reverse(35.732634, 51.422571);\n~~~\nThe reverse is the conversion of geographic coordinates to text addresses\n\u003e Mapir::fastReverse()\n\n~~~\n   \\Mapir::fastReverse(35.732634, 51.422571);\n~~~\nThe 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.\nThe 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.\n## License\n[![FOSSA Status]()]()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmap-ir%2Flaravel-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmap-ir%2Flaravel-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmap-ir%2Flaravel-package/lists"}