movemoveapp/laravel-dadata2
Composer 安装命令:
composer require movemoveapp/laravel-dadata2
包简介
A Laravel SDK for interacting with the DaData API, providing seamless integration for address validation, data enrichment, and other data processing features.
README 文档
README
DaData is an SDK designed to facilitate easy interaction with the DaData API, allowing seamless integration of DaData functionalities within your Laravel applications. This package supports address and company data management for Russia, Belarus, and Kazakhstan. movemoveapp/laravel-dadata2 is the second version of the original movemoveapp/laravel-dadata package, built with a new and improved approach.
This version addresses a wide range of bugs and issues discovered in the first release, offering a more stable and maintainable integration with the DaData API.
Note
The original movemoveapp/laravel-dadata package is no longer maintained and should not be used in new projects.
Features
- Easy integration with the DaData API.
- Support for handling addresses and company data across Russia, Belarus, and Kazakhstan.
- Compatible with Laravel 10 and 11, PHP version 8.
Installation
Install the package via Composer:
composer require movemoveapp/laravel-dadata2
Register the Service Provider
After installing the package, you need to register the DaData service provider.
Up to and including Laravel 10, add the following line to the providers array in your config/app.php file:
... 'providers' => [ ... MoveMoveApp\DaData\DaDataServiceProvider::class, ... ]
From Laravel versions 11 and above, you may edit bootstrap/providers.php file:
<?php return [ ... MoveMoveApp\DaData\DaDataServiceProvider::class, ];
Publish the Configuration
After installation, publish the configuration file to set up the package with Laravel:
php artisan vendor:publish --provider='MoveMoveApp\DaData\DaDataServiceProvider'
Configuration
Once the configuration file is published, you can set up your DaData credentials in your .env file. Obtain your API key and secret key from the DaData dashboard and set them as follows:
... DADATA_KEY=your_dadata_api_key_here DADATA_SECRET_KEY=your_dadata_secret_key_here
These keys will allow your application to authenticate requests to the DaData API.
API
Organization
This facade provides powerful tools to search, validate, and autocomplete Russian legal entities and individual entrepreneurs (IEs) based on data from the official Russian registries (EGRUL and EGRIP).
It helps to:
- Autocomplete company names, INNs, or addresses while typing;
- Narrow results by region, status, type, or industry (OKVED);
- Speed up user input and reduce errors in forms or business logic;
- Get full company details (registration data, address, management, etc.).
- Perfect for autofill scenarios, client onboarding forms, or integration with enterprise directories.
Organization Suggestion
Use this facade to search and autocomplete legal entities and individual entrepreneurs by name, INN, OGRN, address, or director name.
Basic Usage
use MoveMoveApp\DaData\Facades\DaDataOrganization; DaDataOrganization::suggestOrganization([ 'query' => 'мувмув' ]);
Supported Parameters
| Parameter | Type | Description |
|---|---|---|
query |
string | Search string (required). Could be a name, INN, OGRN, address, etc. |
count |
integer | Max number of results to return (default: 10, max: 20). |
type |
string | Organization type: LEGAL (legal entity) or INDIVIDUAL (entrepreneur). |
status |
array | Filter by status: ACTIVE, LIQUIDATING, LIQUIDATED, BANKRUPT, etc. |
okved |
string | Filter by OKVED code (business activity code). |
locations |
array | Filter results by location (e.g. region, city). |
locations_boost |
array | Prioritize results in certain locations. |
Example with Advanced Filters
DaDataOrganization::suggestOrganization([ 'query' => 'авто', 'count' => 5, 'type' => 'LEGAL', 'status' => ['ACTIVE'], 'okved' => '45.11', 'locations' => [['region' => 'Москва']], 'locations_boost' => [['region' => 'Москва']] ]);
Docs
Find Russian Organization
Use this method to retrieve exact information about a Russian company or individual entrepreneur by INN, OGRN, or full name. Unlike the general suggestions, this method performs a precise match and returns full organization data — perfect for backend checks, form validation, or compliance workflows.
use MoveMoveApp\DaData\Facades\DaDataOrganization; DaDataOrganization::findRussianOrganization([ 'query' => (string) $innOrOgrn, 'count' => (int) $limit, // optional, default 1 'kpp' => (string) $kpp, // optional 'branch_type' => 'MAIN'|'BRANCH', // optional 'type' => 'LEGAL'|'INDIVIDUAL', // optional 'status' => ['ACTIVE', 'LIQUIDATED'], // optional ]);
Supported Parameters
| Parameter | Type | Description |
|---|---|---|
query |
string |
Required. INN, OGRN, or full name of the legal entity or sole trader. |
count |
integer |
Number of results to return (default: 1, max: 20). |
kpp |
string |
KPP code — helps narrow down the branch when searching by INN. |
branch_type |
string |
Branch type: MAIN (head office), BRANCH (subsidiary/branch). |
type |
string |
Organization type: LEGAL (legal entity), INDIVIDUAL (sole proprietor). |
status |
array |
Filter by organization status: ACTIVE, LIQUIDATED, LIQUIDATING, etc. |
Docs
Cleaner Methods
The following data types can be standardized (cleaned):
Address Standardization
use MoveMoveApp\DaData\Facades\DaDataCleaner; DaDataCleaner::address('Красная площадь, дом 1');
Features:
- Parses full address into structured fields (region, city, street, house, flat)
- Provides postal code using Russian Post data
- Identifies coordinates (geocoding)
- Detects district, metro station, apartment price and area
- Returns KLADR, FIAS (GAR), OKATO, OKTMO, and tax office codes
- Identifies cadastral number (Russia only)
Docs
Name Standardization
use MoveMoveApp\DaData\Facades\DaDataCleaner; DaDataCleaner::name('иванов иван');
Features:
- Fixes typos and transliteration
- Detects gender
- Provides grammatical inflection
Docs
Phone Standardization
use MoveMoveApp\DaData\Facades\DaDataCleaner; DaDataCleaner::phone('+7 (999) 123-45-67');
Features:
- Validates phone number
- Corrects city code (DEF-code)
- Determines mobile operator (with MNP support)
- Detects country, region, city, timezone
Docs
Passport Standardization
⚠️ Note: Due to issues with the МВД database, data is current as of June 21, 2023.
use MoveMoveApp\DaData\Facades\DaDataCleaner; DaDataCleaner::passport('1234 567890');
Features:
- Validates format
- Checks against invalid passports registry
Docs
Email Standardization
use MoveMoveApp\DaData\Facades\DaDataCleaner; DaDataCleaner::email('ivan@yande.ru');
Features:
- Validates email format
- Fixes common typos
- Detects disposable emails
- Classifies as personal, corporate, or role-based
Docs
Vehicle Standardization
use MoveMoveApp\DaData\Facades\DaDataCleaner; DaDataCleaner::vehicle('Форд Фокус');
Features:
- Recognizes car make and model
Docs
Suggestion Methods
Use this facade to implement autocomplete features in forms or UIs. All methods require a query key in the input array.
Name Suggestion
use MoveMoveApp\DaData\Facades\DaDataSuggestions; DaDataSuggestions::name(['query' => 'иван']);
Features:
- Helps users quickly enter full names in forms
- Suggests surname, first name, and patronymic combinations
- Detects gender
Docs
Passport Unit Suggestion
use MoveMoveApp\DaData\Facades\DaDataSuggestions; DaDataSuggestions::passport(['query' => '770-']);
Features:
- Suggests issuing authorities for Russian passports
- Supports autocomplete for FMS unit codes
Docs
Email Suggestion
use MoveMoveApp\DaData\Facades\DaDataSuggestions; DaDataSuggestions::email(['query' => 'ivan@yand']);
Features:
- Autocompletes email addresses based on popular domains
- Useful for form inputs with typo correction
Docs
Car Brand Suggestion
use MoveMoveApp\DaData\Facades\DaDataSuggestions; DaDataSuggestions::carBrand(['query' => 'фо']);
Features:
- Suggests car makes and models
- Useful for auto-selection interfaces
Docs
Bank Suggestion
use MoveMoveApp\DaData\Facades\DaDataSuggestions; DaDataSuggestions::bank(['query' => 'сбербанк']);
Features:
- Suggests banks by name, BIK, SWIFT, INN, or correspondent account
- Returns complete bank info (address, status, license)
Docs
Bank Lookup by ID
use MoveMoveApp\DaData\Facades\DaDataSuggestions; DaDataSuggestions::bankById(['query' => '044525225']);
Features:
- Searches bank by exact BIK, SWIFT, INN, or correspondent account
- Use when you already have the identifier, not for autocomplete
Docs
movemoveapp/laravel-dadata2 适用场景与选型建议
movemoveapp/laravel-dadata2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.91k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 05 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「address」 「email」 「sdk」 「laravel」 「Bank」 「name」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 movemoveapp/laravel-dadata2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 movemoveapp/laravel-dadata2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 movemoveapp/laravel-dadata2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Maps in minutes. Powered by the Google Maps API.
Redirects TYPO3 visitors automatic or with a suggestlink to another language and/or root page.
Module adding custom shipping attribute for what3words address
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
A modern, feature-rich Laravel package for managing addresses with geocoding, validation, caching, and spatial operations. Perfect for e-commerce, CRM systems, and any application requiring robust address management.
统计信息
- 总下载量: 2.91k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-19