kstkn / dadata Goto Github PK
View Code? Open in Web Editor NEWA PHP library for the DaData.ru REST API
License: MIT License
A PHP library for the DaData.ru REST API
License: MIT License
В ф-ях вашего клиента я такого не нашел.
Привет!
Предлагаю версионироваться по SemVer как все взрослые ребята. Думаю, с 2.0 можно внедрить.
В документации есть https://dadata.ru/api/clean/, а в абстрактном классе Address нет полей:
public $region_fias_id;
public $region_kladr_id;
public $region_with_type;
public $area_fias_id;
public $area_kladr_id;
public $area_with_type;
public $city_fias_id;
public $city_kladr_id;
public $city_with_type;
public $city_area;
public $city_district_fias_id;
public $city_district_kladr_id;
public $city_district_with_type;
public $city_district_type;
public $city_district_type_full;
public $settlement_fias_id;
public $settlement_kladr_id;
public $settlement_with_type;
public $street_fias_id;
public $street_kladr_id;
public $street_with_type;
public $house_fias_id;
public $house_kladr_id;
Особенно расстраивает отсутствие city_area
Добрый день,
какой метод использовать для получения данных по организации
https://dadata.ru/api/suggest/#about-party
если можно пример приведите.
Спасибо.
I have laravel project and some deps is already uset recent version of doctrine/inflector.
When i try to install your lib, got error:
composer require kstkn/dadata
Using version ^1.2 for kstkn/dadata
./composer.json has been updated
Running composer update kstkn/dadata
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires kstkn/dadata ^1.2 -> satisfiable by kstkn/dadata[v1.2.0].
- kstkn/dadata v1.2.0 requires doctrine/inflector ^1.2 -> found doctrine/inflector[v1.2.0, ..., 1.4.x-dev] but the package is fixed to 2.0.3 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
Наткнулся на проблему при стандартизации номера телефона.
Если смотреть, что отдает стандартизация от дадаты по номеру телефона, то получаю следующее:
array:12 [
"source" => "79920073931"
"type" => "Мобильный"
"phone" => "+7 992 007-39-31"
"country_code" => "7"
"city_code" => "992"
"number" => "0073931"
"extension" => null
"provider" => "ООО "Т2 Мобайл""
"region" => "Свердловская область"
"timezone" => "UTC+5"
"qc_conflict" => 0
"qc" => 0
]
После того, как ответ от дадаты обрабатывается библиотекой, то получаю следующее:
Dadata\Response\Phone {#83
+source: "79920073931"
+type: "Мобильный"
+phone: "+7 992 007-39-31"
+country_code: 7
+city_code: 992
+number: 73931
+extension: null
+provider: "ООО "Т2 Мобайл""
+region: "Свердловская область"
+timezone: "UTC+5"
+qc_conflict: 0
+qc: 0
}
Как видно, поле number - имеет int'овое значение, нули обрезаются и если обращаться к этому полю, то финальный номер будет некорректен.
Лечится, если привести это поле к string типу
Неверно разбирается массив правой формы. Дадата отдает 4 элемента массива, а в коде list() присваивает только три значения:
list($code, $full, $short) = array_values($response['data']['opf']);
Hi, I'm trying to get data about Party (eg 7736050003)
Warning: array_values() expects parameter 1 to be array, null given in
/......./vendor/gietos/dadata/src/Client.php on line
314
Catchable fatal error: Argument 2 passed to Dadata\Client::populate() must be of the type array, null given, called in /....../vendor/gietos/dadata/src/Client.php on line 329 and defined in
/......./vendor/gietos/dadata/src/Client.php on line
289
I have Laravel 5.4
$> composer require gietos/dadata
Installation failed, reverting ./composer.json to its original content.
- Installation request for guzzlehttp/guzzle (locked at 6.3.0) -> satisfiable by guzzlehttp/guzzle[6.3.0].
Добрый день. пытаюсь понять как применить этот модуль в моем проекте. Насколько я понимаю он внедряется в контроллер (мне нужно при сохрании формы с данными о человеке автоматически исправлять в ФИО, телефоне и т.д. ошибки и сохранять в базу уже корректный вариант. Верно ли это и можно ли попросить помочь?
Привет! В примере использования указан new Dadata\Client, данного класса нет, new \GuzzleHttp\Client() а GuzzleHttp нету даже в зависимостях
Во время выполнения composer install получаю следующую ошибку:
Illuminate\Foundation\ComposerScripts::postAutoloadDump
>@php artisan package:discover --ansi
In Client.php line 78:
Argument 1 passed to Dadata\Client::__construct() must be an instance of Gu
zzleHttp\ClientInterface, instance of Illuminate\Foundation\Application giv
en, called in /home/domain.com/api/www/vendor/laravel/framework/src/Illumina
te/Foundation/ProviderRepository.php on line 208
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1
php artisan package:discover --ansi
Argument 1 passed to Dadata\Client::__construct() must be an instance of GuzzleHttp\ClientInterface, instance of Illuminate\Foundation\Application given, called in
/home/domain.com/api/www/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 208
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.