PHPackages                             gdinko/econt - 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. [API Development](/categories/api)
4. /
5. gdinko/econt

ActiveLibrary[API Development](/categories/api)

gdinko/econt
============

Laravel Econt API Wrapper

v1.0.17(9mo ago)176.3k↓41.7%10MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3CI passing

Since May 7Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/gdinko/econt)[ Packagist](https://packagist.org/packages/gdinko/econt)[ Docs](https://github.com/gdinko/econt)[ RSS](/packages/gdinko-econt/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (11)Versions (18)Used By (0)

Laravel Econt API Wrapper
=========================

[](#laravel-econt-api-wrapper)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c7f3dd08e609088436f7475d2d214a3e2e858091f00a266a8c8325dffa7f425c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6764696e6b6f2f65636f6e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gdinko/econt)[![Total Downloads](https://camo.githubusercontent.com/b294f8a35405f44ba5c1e91de9875639d52f35c8e3acef86b0c6d995d5e5f90e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6764696e6b6f2f65636f6e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gdinko/econt)

[Econt JSON API Documentation](http://ee.econt.com/services/)

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

[](#installation)

You can install the package via composer:

```
composer require gdinko/econt
```

If you plan to use database for storing nomenclatures:

```
php artisan migrate
```

If you need to export configuration file:

```
php artisan vendor:publish --tag=econt-config
```

If you need to export migrations:

```
php artisan vendor:publish --tag=econt-migrations
```

If you need to export models:

```
php artisan vendor:publish --tag=econt-models
```

If you need to export commands:

```
php artisan vendor:publish --tag=econt-commands
```

Configuration
-------------

[](#configuration)

```
ECONT_ENV=test|production #default=test
ECONT_API_USER= #default=iasp-dev
ECONT_API_PASS= #default=iasp-dev
ECONT_API_TEST_BASE_URI= #default=https://demo.econt.com/ee/services
ECONT_API_PRODUCTION_BASE_URI= #default=https://ee.econt.com/services
ECONT_API_TIMEOUT= #default=5
```

Usage
-----

[](#usage)

Runtime Setup

```
Econt::setAccount('user', 'pass');
Econt::setBaseUrl('endpoint');
Econt::setTimeout(99);
Econt::addAccountToStore('AccountUser', 'AccountPass');
Econt::getAccountFromStore('AccountUser');
Econt::setAccountFromStore('AccountUser');
```

Multiple Account Support In AppServiceProvider add accounts in boot method

```
public function boot()
{
    Econt::addAccountToStore(
        'AccountUser',
        'AccountPass'
    );

    Econt::addAccountToStore(
        'AccountUser_XXX',
        'AccountPass_XXX'
    );
}
```

Methods

```
//Nomenclatures
Econt::getCountries();
Econt::getCities();
Econt::getOffices();
Econt::getStreets();
Econt::getQuarters();

//Labels
Econt::createLabel();
Econt::createLabels();
Econt::updateLabel();
Econt::deleteLabels();

//Misc
Econt::requestCourier();
Econt::getRequestCourierStatus();
Econt::getShipmentStatuses();
Econt::getClientProfiles();
Econt::paymentReport();
```

Commands

```
#sync countries with database (use -h to view options)
php artisan econt:sync-countries

#sync cities with database (use -h to view options)
php artisan econt:sync-cities

#create cities map with other carriers in database  (use -h to view options)
php artisan econt:map-cities

#sync offices with database (use -h to view options)
php artisan econt:sync-offices

#sync querters with database (use -h to view options)
php artisan econt:sync-quarters

#sync stretts with database (use -h to view options)
php artisan econt:sync-streets

#sync all nomenclatures with database (use -h to view options)
php artisan econt:sync-all

#get payments (use -h to view options)
php artisan econt:get-payments

#get econt api status (use -h to view options)
php artisan econt:api-status

#track parcels (use -h to view options)
php artisan econt:track
```

Models

```
CarrierEcontCountry
CarrierEcontCity
CarrierEcontOffice
CarrierEcontStreet
CarrierEcontQuarter
CarrierEcontPayment
CarrierEcontApiStatus
CarrierEcontTracking
CarrierCityMap
```

Events

```
CarrierEcontTrackingEvent
CarrierEcontPaymentEvent
```

Parcels Tracking
----------------

[](#parcels-tracking)

1. Subscribe to tracking event, you will recieve last tracking info, if tracking command is schduled

```
Event::listen(function (CarrierEcontTrackingEvent $event) {
    echo $event->account;
    dd($event->tracking);
});
```

2. Before use of tracking command you need to create your own command and define setUp method

```
php artisan make:command TrackCarrierEcont
```

3. In app/Console/Commands/TrackCarrierEcont define your logic for parcels to be tracked

```
use Gdinko\Econt\Commands\TrackCarrierEcontBase;

class TrackCarrierEcontSetup extends TrackCarrierEcontBase
{
    protected function setup()
    {
        //define parcel selection logic here
        // $this->parcels = [];
    }
}
```

4. Use the command

```
php artisan econt:track
```

Examples
--------

[](#examples)

Address Validation

```
try {
    $address = new Address([
        'city' => [
            'name' => 'София'
        ],
        'street' => 'България',
        'num' => '100'
    ]);

    dd(Econt::validateAddress($address));
} catch (EcontValidationException $eve) {
    echo $eve->getMessage();
    echo $eve->getCode();
    print_r($eve->getErrors());
} catch (EcontException $ee) {
    echo $ee->getMessage();
    echo $ee->getCode();
    print_r($ee->getErrors());
}
```

Get Nearest Offices to Address

```
try {
    $address = new Address([
        'city' => [
            'name' => 'София'
        ],
        'street' => 'България',
        'num' => '100'
    ]);

    dd(Econt::getNearestOffices($address));
} catch (EcontValidationException $eve) {
    echo $eve->getMessage();
    echo $eve->getCode();
    print_r($eve->getErrors());
} catch (EcontException $ee) {
    echo $ee->getMessage();
    echo $ee->getCode();
    print_r($ee->getErrors());
}
```

Calculcate Price

```
$labelData = [
    'senderClient' => [
        'name' => 'Иван Иванов',
        'phones' => [
            0 => '0888888888',
        ],
    ],
    'senderAddress' => [
        'city' => [
            'country' => [
                'code3' => 'BGR',
            ],
            'name' => 'София',
            'postCode' => 1000,
        ],
    ],
    'senderOfficeCode' => '1127',
    'receiverAddress' => [
        'city' => [
            'country' => [
                'code3' => 'BGR',
            ],
            'name' => 'София',
            'postCode' => 1000,
        ],
        'street' => 'България',
        'num' => '100',
    ],
    'packCount' => 1,
    'shipmentType' => ShipmentType::PACK,
    'weight' => 3.4,
    'shipmentDescription' => 'обувки',
    'services' => [
        'cdAmount' => 122.59,
        'cdType' => 'get',
        'cdCurrency' => 'BGN',
        'smsNotification' => true,
    ],
    'payAfterAccept' => false,
    'payAfterTest' => false,
];

$label = new Label(
    $labelData,
    LabelMode::CALCULATE
);

$result = Econt::createLabel($label);
```

Create Label

```
$labelData = [
    'senderClient' => [
        'name' => 'Иван Иванов',
        'phones' => [
            0 => '0888888888',
        ],
    ],
    'senderAddress' => [
        'city' => [
            'country' => [
                'code3' => 'BGR',
            ],
            'name' => 'София',
            'postCode' => 1000,
        ],
    ],
    'senderOfficeCode' => '1127',
    'receiverClient' =>
    [
        'name' => 'Димитър Димитров',
        'phones' =>
        [
            0 => '0876543210',
        ],
    ],
    'receiverAddress' => [
        'city' => [
            'country' => [
                'code3' => 'BGR',
            ],
            'name' => 'София',
            'postCode' => '1000',
        ],
        'street' => 'България',
        'num' => 100,
    ],
    'packCount' => 1,
    'shipmentType' => ShipmentType::PACK,
    'weight' => 3.4,
    'shipmentDescription' => 'обувки',
    'services' => [
        'cdAmount' => '122.59',
        'cdType' => 'get',
        'cdCurrency' => 'BGN',
        'smsNotification' => true,
    ],
    'payAfterAccept' => false,
    'payAfterTest' => false,
    'holidayDeliveryDay' => 'workday',
];

$label = new Label(
    $labelData,
    LabelMode::CREATE
);

$result = Econt::createLabel($label);
```

Request Courier

```
try {
    $curierRequest = [
        'requestTimeFrom' => '2022-05-05 16:00:00',
        'requestTimeTo' => '2022-05-05 17:00:00',
        'shipmentType' => 'PACK',
        'shipmentPackCount' => '1',
        'shipmentWeight' => '2',
        'senderClient' => [
            'name' => 'Иван Иванов',
            'phones' => [
                0 => '0888888888',
            ],
        ],
        'senderAddress' => [
            'city' => [
                'country' => [
                    'code3' => 'BGR',
                ],
                'postCode' => '7012',
                'name' => 'Русе',
            ],
            'fullAddress' => 'Алея Младост 7',
        ],
    ];

    dd(
        Econt::requestCourier(
            new Courier($curierRequest)
        )
    );
} catch (EcontValidationException $eve) {
    echo $eve->getMessage();
    echo $eve->getCode();
    print_r($eve->getErrors());
} catch (EcontException $ee) {
    echo $ee->getMessage();
    echo $ee->getCode();
    print_r($ee->getErrors());
}
```

Get Payments

```
try {
    dd(
        Econt::paymentReport(new Payment([
            'dateFrom' => '2022-05-01',
            'dateTo' => '2022-05-05'
        ]))
    );
} catch (EcontValidationException $eve) {
    echo $eve->getMessage();
    echo $eve->getCode();
    print_r($eve->getErrors());
} catch (EcontException $ee) {
    echo $ee->getMessage();
    echo $ee->getCode();
    print_r($ee->getErrors());
}
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

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

Credits
-------

[](#credits)

- [Dinko Georgiev](https://github.com/gdinko)
- [silabg.com](https://www.silabg.com/) ❤️
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance58

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~75 days

Recently: every ~150 days

Total

17

Last Release

273d ago

PHP version history (3 changes)v1.0.0PHP ^7.4|^8.0

v1.0.14PHP ^7.4|^8.0|^8.1

v1.0.15PHP ^7.4|^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/f408c26073a07cc3190b341d6c9deee83d57841262fa5be6fa2cc0512deb5575?d=identicon)[gdinko](/maintainers/gdinko)

---

Top Contributors

[![gdinko](https://avatars.githubusercontent.com/u/2735905?v=4)](https://github.com/gdinko "gdinko (90 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![YordanY1](https://avatars.githubusercontent.com/u/46786238?v=4)](https://github.com/YordanY1 "YordanY1 (1 commits)")

---

Tags

laravelgdinkoecontecont laravel

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/gdinko-econt/health.svg)

```
[![Health](https://phpackages.com/badges/gdinko-econt/health.svg)](https://phpackages.com/packages/gdinko-econt)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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