Code Monkey home page Code Monkey logo

movemoveapp / laravel-dadata Goto Github PK

View Code? Open in Web Editor NEW
43.0 43.0 32.0 149 KB

PHP SDK Laravel пакет работы с сервисом DaData.ru, для исправления синтаксических ошибок в информации контактных данных клиентов сайта и вывода подсказок поля форм.

License: MIT License

PHP 100.00%
dadata laravel laravel-package movemove movemoveapp php sdk-php

laravel-dadata's People

Contributors

pipisco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

laravel-dadata's Issues

The package breaks the Russian localization for Carbon

When installing the package, the Russian localization of Carbon breaks down.

'locale' => 'ru'

config/app.php

$date = Carbon::now(); $dayName = $date->getTranslatedDayName(); // 'Monday', but without the package it would be 'Понедельник'

Версия laravel

Добрый день.

В laravel 5.8 пакет illuminate/support такой же версии 5.8

для composer require movemoveapp/laravel-dadata - requires illuminate/support ^8.8.0

Получается ваш пакет встанет только на laravel 8. Просто в readme написано что делать для версий ниже 5.5 , а по факту оно туда и не установится.

Условия поиска по ИНН или ОГРН

В документации указано что поиск будет произведен по всем филиалам, то есть по умолчанию не указывается branch_type
https://dadata.ru/api/find-party/

У вас в коде
https://github.com/movemoveapp/laravel-dadata/blob/master/src/DaDataCompany.php#L39
По умолчанию MAIN (можно изменить на BRANCH) но нельзя указать null, чтобы не передавалось и был произведен поиск по всем филиалам

Возможно я не до конца разобрался в документации, но если это так исправьте пожалуйста

Token error if config:cache

hi there

after:
artisan config:cache

or:
artisan optimize

got:
exception: "TypeError" file: "/var/www/html/vendor/movemoveapp/laravel-dadata/src/Providers/CleanerDaDataProvider.php" line: 52 message: "MoveMoveIo\\DaData\\Providers\\CleanerDaDataProvider::__construct(): Argument #1 ($token) must be of type string, null given, called in /var/www/html/vendor/movemoveapp/laravel-dadata/src/DaDataService.php on line 88"

Ошибка в методе DaDataCompany::prompt

movemoveapp/laravel-dadata: 1.0.10
Передаю параметр string $locations = '66' в метод, а в сформированном запросе на выходе из метода
{
"query": "Федерация акро",
"count": 1,
"status": [ "ACTIVE" ],
"type": "LEGAL",
"locations": [ { "kladr_id": "6" } ],
"locations_boost": []
}
Одна шестерка потерялась, тоже самое происходит со всеми двузначными цифрами. Нужно изменить код немного в этом методе.

    if (! is_null($locations)) {
        $locations = explode(',', $locations);
        for ($i = 0; $i < count($locations); $i++) {
            array_push($locations_array, ['kladr_id' => trim($locations[$i])]);
        }
    }

Ошибка в методе id class DaDataCompany

Добрый день. В методе параметр $type ожидается как CompanyType, а в сам запрос отправляется как CompanyStatus.

public function id(
        string $id,
        int $count = 10,
        string $kpp = null,
        int $branch_type = BranchType::MAIN,
        int $type = CompanyType::LEGAL
    ): array {
        dd(CompanyStatus::$map[$type]);
        return $this->suggestApi()->post('rs/findById/party', [
            'query'             => $id,
            'count'             => $count,
            'kpp'               => $kpp,
            'branch_type'       => BranchType::$map[$branch_type] ?? BranchType::$map[BranchType::MAIN],
            'type'              => CompanyStatus::$map[$type] ?? null,
        ]);
    }

INDIVIDUAL check error

Hi!

In Providers/DaDataCompany.php on line 40 there is error (which you can catch if you try to check INDIVIDUAL by INN number).
On property 'type' - wrong ENUM in value. Instead of "CompanyType::$map[$type] ?? null" there is "CompanyStatus::$map[$type] ?? null" (status instead of type).

I've fixed it manually, but it would be better to fix this in release.

DaData v2

DaData V2

Dear community, a planing make a new version for DaData Laravel package. It's main issue for working with DaData integration. Grow speed and fixing all bugs.

  • Type cast for all models
  • New DaData API interface
  • New tests
  • Bugfixing

Using $this when not in object context Laravel Dadata

Добрый день установил плагин с игнор версией, а также пробовал устанавливать версию от ребят из сушимаркета (https://github.com/sushi-market/laravel-dadata) но всё равно выбивает эту ошибку при запросе:

exception: "Error"
file: "/home/cotit/dev3/vendor/movemoveapp/laravel-dadata/src/DaDataAddress.php"
line: 59
message: "Using $this when not in object context"

В чём проблема?

Company search always with legal entity or individual filter

At the moment, only a crutch can be used to search for companies, both individuals and legal entities, for this you need to pass a value that does not exist in CompanyType, since null cannot be passed. This is wrong, you need to add support so that when searching for a company, you should not be limited to searching only for legal entities or individuals. Just add support for int|null in the DaDataCompany::prompt(type: null) argument

int $type = CompanyType::INDIVIDUAL,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.