{"id":28927936,"url":"https://github.com/carloeusebi/laravel-comuni","last_synced_at":"2026-04-22T23:35:43.168Z","repository":{"id":300385953,"uuid":"1006028023","full_name":"carloeusebi/laravel-comuni","owner":"carloeusebi","description":"A Laravel package that provides a simple and elegant way to retrive italian comuni, province and regioni. This package uses third party apis and provides only an easy wrapper to access those apis.","archived":false,"fork":false,"pushed_at":"2026-03-17T16:52:57.000Z","size":239,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T06:42:08.292Z","etag":null,"topics":["comuni","italian","italiano","laravel","province","regioni"],"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/carloeusebi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-21T10:26:46.000Z","updated_at":"2026-03-17T16:52:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"6d52515d-3bf1-40f9-a82b-f4b56de9d479","html_url":"https://github.com/carloeusebi/laravel-comuni","commit_stats":null,"previous_names":["carloeusebi/laravel-comuni"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/carloeusebi/laravel-comuni","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloeusebi%2Flaravel-comuni","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloeusebi%2Flaravel-comuni/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloeusebi%2Flaravel-comuni/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloeusebi%2Flaravel-comuni/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carloeusebi","download_url":"https://codeload.github.com/carloeusebi/laravel-comuni/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carloeusebi%2Flaravel-comuni/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32159959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["comuni","italian","italiano","laravel","province","regioni"],"created_at":"2025-06-22T14:11:17.382Z","updated_at":"2026-04-22T23:35:43.160Z","avatar_url":"https://github.com/carloeusebi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/carloeusebi/laravel-comuni/actions\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Tests\" src=\"https://github.com/carloeusebi/laravel-comuni/actions/workflows/tests.yml/badge.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/carloeusebi/laravel-comuni\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Total Downloads\" src=\"https://img.shields.io/packagist/dt/carloeusebi/laravel-comuni\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/carloeusebi/laravel-comuni\" target=\"_blank\"\u003e\n    \u003cimg alt=\"Latest Version\" src=\"https://img.shields.io/packagist/v/carloeusebi/laravel-comuni\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/carloeusebi/laravel-comuni\" target=\"_blank\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/packagist/l/carloeusebi/laravel-comuni\"\u003e\n\u003c/a\u003e\n\n# Laravel Comuni\n\nA Laravel package that provides a simple and elegant way to retrive italian comuni, province and regioni.\nThis package uses third party apis and provides only an easy wrapper to access those apis.\n\nCurrently supported apis:\n\n- [Samurai016/Comuni-ITA](https://github.com/Samurai016/Comuni-ITA)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require carloeusebi/laravel-comuni\n```\n\nThe package will automatically register its service provider.\n\n## Usage\n\nThis package provides a simple facade to access Italian geographical data:\n\n```php\nuse CarloEusebi\\LaravelComuni\\Facades\\Comuni;\n\n// Get all regions\n$regions = Comuni::regioni();\n\n// Get all provinces\n$provinces = Comuni::province();\n\n// Get all municipalities\n$comuni = Comuni::comuni();\n\n// Get municipalities by region\n$comuni = Comuni::comuni(regione: 'Lazio');\n\n// Get municipalities by province\n$comuni = Comuni::comuni(provincia: 'Roma');\n```\n\n### Filtering and Pagination\n\nYou can filter and paginate results using the `params` array:\n\n```php\n// Get municipalities with pagination\n$comuni = Comuni::comuni(params: ['page' =\u003e 1, 'pagesize' =\u003e 10]);\n\n// Filter municipalities by name\n$comuni = Comuni::comuni(params: ['nome' =\u003e 'Roma']);\n\n// Get only municipality names\n$comuni = Comuni::comuni(params: ['onlyname' =\u003e true]);\n\n// Filter regions by name\n$regions = Comuni::regioni(['nome' =\u003e 'Lazio']);\n```\n\n### Available Parameters\n\nFor available parameters please refer to third parties documentations:\n\n- [Samurai016/Comuni-ITA](https://comuni-ita.readme.io/reference/comuni-1)\n\n## Configuration\n\nYou can publish the configuration file with:\n\n```bash\nphp artisan vendor:publish --provider=\"CarloEusebi\\LaravelComuni\\ComuniServiceProvider\"\n```\n\nThis will create a `config/comuni.php` file where you can modify the default settings:\n\nYou can safely cache the responses for a long period of time. As these services are hosted on free platforms, please\nconsider keeping responses cached as long as possible.\n\n```php\nreturn [\n\n    // currently the only provider is `comuni-ita`\n    'provider' =\u003e 'comuni-ita',\n\n    'cache' =\u003e [\n        // the prefix for the cache key\n        'prefix' =\u003e 'comuni-',\n\n        // the number of days the responses should be cached for\n        'ttl' =\u003e 60,\n\n        // the number of days after which the cache becomes stale\n        'stale' =\u003e 30,\n    ],\n];\n```\n\n## Response Format\n\nAll methods return Laravel Collections. Here's an example of the data structure for each type:\n\n### Comuni\n\n```php\n[\n    'codice' =\u003e '058091',\n    'nome' =\u003e 'Roma',\n    'nomeStraniero' =\u003e 'Rome',\n    'cap' =\u003e ['00118', '00121', '00122', ...],\n    'prefisso' =\u003e '06',\n    'provincia' =\u003e [\n        'codice' =\u003e '058',\n        'nome' =\u003e 'Roma',\n        'sigla' =\u003e 'RM',\n        'regione' =\u003e 'Lazio'\n    ],\n    'email' =\u003e 'protocollo.gabinettosindaco@pec.comune.roma.it',\n    'pec' =\u003e 'protocollo.gabinettosindaco@pec.comune.roma.it',\n    'telefono' =\u003e '0667101',\n    'fax' =\u003e '0667103590',\n    'popolazione' =\u003e 2873494,\n    'coordinate' =\u003e [\n        'lat' =\u003e 41.89277,\n        'lng' =\u003e 12.48366\n    ]\n]\n```\n\n### Province\n\n```php\n[\n    'codice' =\u003e '058',\n    'nome' =\u003e 'Roma',\n    'sigla' =\u003e 'RM',\n    'regione' =\u003e 'Lazio'\n]\n```\n\n### Regioni\n\nReturns a collection of region names as strings:\n\n```php\n['Abruzzo', 'Basilicata', 'Calabria', ...]\n```\n\n## Faking\n\nThis package already has a comprehensive test suite. You don't need to test this package in your app.\nBut if you would like to test your implementation of this package, you can mock `Comuni` and decide what it should\nreturn, or you can fake it and this package will generate a fake generic response for you.\n\n```php\n\\CarloEusebi\\LaravelComuni\\Facades\\Comuni::fake();\n\n\\CarloEusebi\\LaravelComuni\\Facades\\Comuni::shouldReceive('comuni')-\u003eandReturn(collect(['Abano Terme', 'Abbadia Cerreto', 'Abbadia Lariana', 'Abbadia San Salvatore']));\n```\n\n## Testing\n\nThis package includes a comprehensive test suite. To run tests:\n\n```bash\ncomposer test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloeusebi%2Flaravel-comuni","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarloeusebi%2Flaravel-comuni","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarloeusebi%2Flaravel-comuni/lists"}