- How do I install fomvasss/laravel-dadata in a Laravel application?
- Install it with composer require fomvasss/laravel-dadata, then publish the package config and add your Dadata credentials to the .env file. The package is a service provider that binds an API client into the container and exposes a facade, so there are no migrations, models, or queue tables to set up. After that you can call the facade directly for address, company, or bank lookups.
- Which environment variables does laravel-dadata need for the Dadata API?
- You need a Dadata API token and secret, typically stored as DADATA_API_KEY and DADATA_SECRET after publishing the package config. The configuration also generally separates the suggestions endpoint from the clean/normalization endpoint base URLs. Publish the config file and adjust those values if you use a different Dadata tier or endpoint version.
- What kind of data can I look up with fomvasss/laravel-dadata?
- The wrapper covers the main Dadata.ru primitives: address suggestions and normalization against Russian reference data, company details by INN, bank data by BIK, and cleaning of phone, email, and name fields. It is a thin adapter over the HTTP API rather than a data store, so results come straight from Dadata. That makes it a fit for RU/CIS-facing e-commerce, CRM, ERP, and logistics flows.
- Is fomvasss/laravel-dadata compatible with recent Laravel and PHP versions?
- You need to check the version constraints in the package composer.json before adopting it, because the repository shows no stars, no dependents, and low apparent activity. A dormant wrapper can easily lag behind current Laravel and PHP releases, especially around service-provider and HTTP client conventions. If your app is on a recent Laravel version, verify compatibility locally and be prepared to fork or patch.
- How do I mock or fake Dadata API calls when testing a Laravel app?
- The safest approach is to hide the facade behind your own interface, such as AddressNormalizer or CompanyLookup, and inject that into your classes so tests can swap a fake implementation. Mocking the package facade directly couples your tests to its internals and gets awkward if the package changes. Whether HTTP-level faking works depends on whether the client uses Guzzle directly or Laravel's Http client, so confirm that first.
- Does laravel-dadata handle rate limits, retries, and timeouts automatically?
- The package appears to issue bare requests with no documented retry with backoff, timeout policy, or circuit breaking. Since there are no visible downstream consumers, edge cases like rate limiting and malformed or partial suggestion payloads are likely untested territory. Plan to add timeouts, retry logic, and failure handling in your own adapter layer rather than relying on the wrapper.
- Is fomvasss/laravel-dadata safe to use in a production Laravel application?
- Mechanically it is simple to run, but the maintenance risk is the dominant concern: a single maintainer, no community backstop, and no demonstrated battle-testing. Treat the package as a disposable adapter behind an interface you own rather than a dependency baked into domain code. Also watch for Dadata API field and endpoint changes, since a dormant wrapper will not keep pace with them.
- How does fomvasss/laravel-dadata compare to the official Dadata SDK?
- The official SDK is vendor-maintained and not tied to a framework, which makes it the better choice for polyglot or non-Laravel services. This package wins on Laravel ergonomics: config-driven credentials, container binding, and a facade, with no infrastructure to stand up. For a small integration you could also write a roughly 150-line in-house HTTP client and own it outright.
- Can I use Dadata from outside Russia, and are there data residency concerns?
- Dadata's value is concentrated in Russian and CIS reference data, so the use case itself is usually RU-facing. Sending PII such as addresses, names, and phone numbers to Dadata endpoints raises jurisdiction and data-residency questions that need legal and procurement review. You should also confirm the commercial quota, sandbox or test tier availability, and the data-processing terms before shipping.
- How should I structure code using laravel-dadata to avoid locking my domain to the facade?
- Define owned ports such as AddressNormalizer, CompanyLookup, and ContactCleaner, then write a DadataAdapter that delegates to this package behind them. Consumers should depend on your interfaces, never on the facade, so you can inject rather than resolve statically. That keeps the wrapper replaceable if you later switch to the official SDK, an in-house client, or a different provider.