PHPackages                             arttiger/laravel-scoring - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. arttiger/laravel-scoring

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

arttiger/laravel-scoring
========================

Integration of scoring systems for Laravel

v1.4.0(1mo ago)0213MITPHPPHP ^7.1|^8.0

Since Sep 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/arttiger/laravel-scoring)[ Packagist](https://packagist.org/packages/arttiger/laravel-scoring)[ Docs](https://github.com/arttiger/laravel-scoring)[ RSS](/packages/arttiger-laravel-scoring/feed)WikiDiscussions dev Synced yesterday

READMEChangelog (6)Dependencies (8)Versions (9)Used By (0)

Laravel Scoring
===============

[](#laravel-scoring)

 [![StyleCI Status](https://camo.githubusercontent.com/993618d9f2a8bf4080e32a97c9a298fb4c72ee95b2c263e64db67cb3788ee8ce/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3430323038373235322f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/402087252) [![Total Downloads](https://camo.githubusercontent.com/3774a01994dc685d248f8b9b0e056eb49227c52558b6b66149d934d6da4d2eec/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61727474696765722f6c61726176656c2d73636f72696e673f7374796c653d666c6174)](https://packagist.org/packages/arttiger/laravel-scoring) [![Latest Stable Version](https://camo.githubusercontent.com/f39882fd00f388ac82cacaf98682ba457e34850ed18961f560883ad5daf2c39a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61727474696765722f6c61726176656c2d73636f72696e673f7374796c653d666c6174)](https://packagist.org/packages/arttiger/laravel-scoring) [![License](https://camo.githubusercontent.com/15a0f55036070b8325148a54ceba7e269dfba5b0238067add0c9fd55aefc3a97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61727474696765722f6c61726176656c2d73636f72696e673f7374796c653d666c6174)](https://packagist.org/packages/arttiger/laravel-scoring)

Integration of scoring systems for Laravel. The package provides integration scoring systems:

- RiskTools

Installation
------------

[](#installation)

Install the package via composer:

```
composer require arttiger/laravel-scoring

```

### Configuration

[](#configuration)

In order to edit the default configuration you may execute:

```
php artisan vendor:publish --provider="Arttiger\Scoring\ScoringServiceProvider" --tag="config"

```

After that, `config/scoring.php` will be created.

### Environment

[](#environment)

Set environment variable (`.env`)

```
RISK_TOOLS_URL=
RISK_TOOLS_KEY=

```

Usage
-----

[](#usage)

#### Get scoring data

[](#get-scoring-data)

You can get data from the scoring system as follows:

```
$result = Scoring::scoring('risk_tools', $attributes);

```

- 'risk\_tools' - scoring system;
- $attributes - data (array) from the credit model according to the mapping of variables in `config/scoring.php`. This map establishes the correspondence between the attributes of your model and the required query fields in scoring system.

```
'model_data' => [
    // For "scoring" method
    'id'              => 'public_id',     // ID of loan
    'user_id'         => 'client_id',     // ID of client
    'social_number'   => 'inn',           // INN of client
    'phone'           => 'phone',         // Phone of client
    'email'           => 'email',         // Email of client
    'passport_number' => 'passport',      // Passport (example АА123456 or number ID-card)
    'passport_date'   => 'passport_date', // Passport issue date (example "2001-12-01")
    'first_name'      => 'firstName',     // First name
    'last_name'       => 'lastName',      // Last name
    'other_name'      => 'middleName',    // Middle name
    'birth_date'      => 'birth_date',    // Birth date (example "2001-12-01")
    'gender_id'       => 'gender_id',     // Gender (1 - male, 2 - female)
    'loan_amount'     => 'sum',           // Amount of credit
    'loan_days'       => 'period',        // Number days of credit
    'applied_at'      => 'created_at',    // Date and time created loan (example "2018-04-05T19:29:51+03:00")
    'ip'              => 'ip',            // IP of client
    'user_agent'      => 'user_agent',    // User-Agent of browser of client
    'ubki'            => 'ubki',          // XML-data from UBKI

    // For updating of statuses
    'status_id'       => 'status_code',   // Status code of credit (1 - NEW, 2 - REJECT, 3 - APPROVED, 4 - ISSUED, 5 - CLOSED, 6 - OVERDUE)
    'closed_at'       => 'closed_at',     // Date and time close loan (example "2018-04-25T10:05:00+03:00")
    'amount_to_pay'   => 'amount_debt',   // Total debt
    'total_paid'      => 'total_paid',    // The sum of all payments
    'overdue_days'    => 'overdue_days',  // The total number of days of delay of loan
],

```

`$result` - response from scoring system (array).

```
$result = [
    "group" => 4,
    "score" => 0.495,
    "amount_limit_max" => 1200,
    "amount_limit" => 1000.0,
    "filters" => [],
    "score_model" => [
        "version" => "v1_7"
    ]
]

```

#### Send status of credit

[](#send-status-of-credit)

Send status of credit to the scoring system as follows:

```
$result = Scoring::status('risk_tools', $attributes);

```

- 'risk\_tools' - scoring system;
- $attributes - data (array) from the credit model according to the mapping of variables

#### Get the UBKI reports

[](#get-the-ubki-reports)

Get the UBKI reports from the scoring system as follows:

```
$result = Scoring::ubkiReport('risk_tools', ['public_id' => $public_id]);

```

- $public\_id - ID of credit

```
$result = [
    "reports": [
        [
            "report_date" => "2018-12-25",
            "xml" => ""
        ],
        [
            "report_date" => "2018-12-25",
            "xml" => ""
        ]
    ]
]

```

#### Get pre-scoring data

[](#get-pre-scoring-data)

You can get data from the pre-scoring system as follows:

```
$result = Scoring::pre_scoring('risk_tools', ['social_number' => $social_number]);

```

- $social\_number - Social number (INN) of client

#### Trait

[](#trait)

Add `ScoringTrait`-trait to the model with client data:

```
    use Arttiger\Scoring\Traits\ScoringTrait;

    class Loan extends Model
    {
        use ScoringTrait;
        ...
    }

```

Add a new method `scoringAttributes()` to the class to add the necessary attributes and fill them with data:

```
    use Arttiger\Scoring\Traits\ScoringTrait;

    class Loan extends Model
    {
        use ScoringTrait;
        ...

        public function scoringAttributes()
        {
            $client_data = json_decode($this->attributes['client_data']);
            $this->attributes['client_id']  = trim($client_data->id);
            $this->attributes['inn']        = trim($client_data->code);
            $this->attributes['lastName']   = trim($client_data->lastName);
            ...
        }
    }

```

You can use other ways to create custom attributes that you specified in `'model_data'` (`config/scoring.php`).

### Change log

[](#change-log)

Please see the [changelog](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](CONTRIBUTING.md) for details and a todolist.

### Security

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits
-------

[](#credits)

[Volodymyr Farylevych](https://github.com/arttiger)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance89

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~237 days

Recently: every ~268 days

Total

8

Last Release

53d ago

PHP version history (2 changes)v1.0.0PHP ^7.1

v1.0.1PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/63ea581311941682a78de132261c405a35be7113b60482778b89afa8c5e36c32?d=identicon)[vfarylevych](/maintainers/vfarylevych)

---

Top Contributors

[![arttiger](https://avatars.githubusercontent.com/u/88475172?v=4)](https://github.com/arttiger "arttiger (5 commits)")

---

Tags

laravelscoring

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arttiger-laravel-scoring/health.svg)

```
[![Health](https://phpackages.com/badges/arttiger-laravel-scoring/health.svg)](https://phpackages.com/packages/arttiger-laravel-scoring)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M686](/packages/barryvdh-laravel-ide-helper)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
