1. Go to this page and download the library: Download imjonos/laravel-dadata-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
imjonos / laravel-dadata-api example snippets
use Nos\DadataApi\Facades\DadataApi;
// Get city suggestions
$collection = DadataApi::suggestCity('Москва');
foreach ($collection as $suggestion) {
echo $suggestion->value;
echo $suggestion->data->fiasId;
}
// Filter by country
$collection = DadataApi::suggestCity('London', ['GB']);
// Street suggestions (
use Nos\DadataApi\Facades\DadataApi;
// Search company by INN
$collection = DadataApi::suggestCompany('7707083893');
$company = $collection->first();
echo $company->value; // Company name
echo $company->inn;
echo $company->ogrn;
echo $company->okpo;
$suggestion->value; // Display value
$suggestion->unrestrictedValue; // Full value
$suggestion->street; // Street name
$suggestion->city; // City
$suggestion->fiasId; // FIAS ID