wowworks / geocoder-php-dadata-provider
Integration with Dadata suggestions API.
Package info
github.com/wowworks-team/geocoder-php-dadata-provider
pkg:composer/wowworks/geocoder-php-dadata-provider
v1.1.6
2026-02-03 12:46 UTC
Requires
- php: >=5.6.0
- willdurand/geocoder: ^4.2
- wowworks/dadata-suggestions: ^1.0
Requires (Dev)
- ext-curl: *
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^8.5
- squizlabs/php_codesniffer: 3.6.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Geocoder DaData adapter
Geocoder DaData adapter. Integration with Dadata suggestions API.
Installation
This extension is available at packagist.org and can be installed via composer by following command:
composer require wowworks/geocoder-php-dadata-provider
Configuration
To work, you need to connect the package wowworks/geocoder-php-dadata-provider
Example:
$service = new \DadataSuggestions\DadataSuggestionsService(); $service->setUrl('https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/'); $service->setToken('...'); $dadataProvider = new \Wowworks\Dadata\Dadata($service); $collection = $dadataProvider->geocodeQuery(\Geocoder\Query\GeocodeQuery::create('г Москва, улица Академика Королева, дом 15, корп. 2')); foreach ($collection->all() as $location) { $location->getCoordinates()->getLatitude(); $location->getCoordinates()->getLongitude(); $location->getCountry(); foreach ($location->getAdminLevels() as $level) { if ($level instanceof AdminLevel) { $level->getName(); } } $location->getLocality(); $location->getSubLocality(); $location->getStreetName(); $location->getStreetNumber(); $location->getProvidedBy(); }