PHPackages                             sergeevpasha/laravel-pecom - 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. sergeevpasha/laravel-pecom

ActiveLibrary[API Development](/categories/api)

sergeevpasha/laravel-pecom
==========================

Pecom API wrapper for Laravel

v1.4.1(2y ago)11.8k↓50%1[4 PRs](https://github.com/sergeevpasha/laravel-pecom/pulls)MITPHPPHP ^8.0CI failing

Since Jul 6Pushed 6mo ago1 watchersCompare

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

READMEChangelog (7)Dependencies (8)Versions (13)Used By (0)

[![Maintainability](https://camo.githubusercontent.com/ba71c467b904588c847501604631a2630d499accd09ab4ce3cca83ff7709e7d3/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38633337336231323933353562653265333438642f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/sergeevpasha/laravel-pecom/maintainability)[![Test Coverage](https://camo.githubusercontent.com/ffbe6f7674fa292307982deb52a3b3cfd316383eb0192d79d5a43ac80a29e3d2/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38633337336231323933353562653265333438642f746573745f636f766572616765)](https://codeclimate.com/github/sergeevpasha/laravel-pecom/test_coverage)[![CodeFactor](https://camo.githubusercontent.com/ab37b594945473c8b884b536754e028c90818ad3aac236ccff334fd5bd9e92d1/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f7365726765657670617368612f6c61726176656c2d7065636f6d2f6261646765)](https://www.codefactor.io/repository/github/sergeevpasha/laravel-pecom)[![Generic badge](https://camo.githubusercontent.com/178b702128001ab3379109a965c0eaffdf3daab6c1c9b442c3985506eed159e9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e302e2a2d626c75652e737667)](https://www.php.net)[![Generic badge](https://camo.githubusercontent.com/6ee57e7d33edc9c4e17da57004e842ef0d04c0dac5c62de6b5e2cbe2b19dd4ad/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d253545382e32372e2a2d7265642e737667)](https://laravel.com)

Laravel PECOM API Wrapper
=========================

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

Allows you to:

- Find a City by query string
- Find all Terminals in the City by City ID
- Calculate a delivery price

Pre-requirements
----------------

[](#pre-requirements)

You need to get Pecom API key and login. Key can be obtained in your cabinet at

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

[](#installation)

```
composer require sergeevpasha/laravel-pecom
```

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

[](#configuration)

This package has a few configuration values:

```
'key'        => env('PECOM_KEY', null),
'user'       => env('PECOM_USER', null),
'prefix'     => 'pecom',
'middleware' => ['web']
```

If you only need to use PecomClient, you may completely skip this configuration. Otherwise, you can use default options and just specify PECOM\_KEY and PECOM\_USER at .env file. To make full use of predefined routes, you will need to publish config:

```
php artisan vendor:publish --provider="SergeevPasha\Pecom\Providers\PecomServiceProvider" --tag="config"
```

Now you can change routes prefix and middleware to whatever you need

### Use Case #1

[](#use-case-1)

After installing, you may just import the client

```
use SergeevPasha\Pecom\Libraries\PecomClient;
```

Now you need to initialize it:

```
$client = new PecomClient('user', 'key');
```

Now we can use these methods:

```
$client->findCity(string $query)
$client->getCityTerminals(int $cityId)
/* This one requires a Delivery Object, see next to see how to build it */
$client->getPrice(Delivery $delivery)
```

Delivery Object
---------------

[](#delivery-object)

To build a Delivery object you will need to pass an array to fromArray() method just like that:

```
Delivery::fromArray([
    'arrival_city_id'                 => '123', // Arrival City ID, can be found using findCity() method
    'derival_city_id'                 => '123456', // Derival City ID, can be found using findCity() method
    'arrival_open_car'                => '1', // Boolean. Removable Curtains for arrival car
    'derival_open_car'                => '1, // Boolean. Removable Curtains for derival car
    'arrival_distance_type'           => '2', // Distance Type, Moscow ONLY
                                                  0 - NONE,
                                                  1 - Require transportation by Sadovoe Koltso
                                                  2 - Require transportation by Moscow district railway
                                                  3 - Require transportation by Third Transport Ring
    'derival_distance_type'           => '0', // Same as arrival
    'one_day_delivery'                => '1', // Boolean, day by day delivery
    'is_shop'                         => '0', // Boolean, sender is a shop
    'pay_date'                        => '2020-10-10', // Payment date
    'arrival_address'                 => '1', // Boolean, if delivery is required (means you are not using terminal)
    'derival_address'                 => '1', // Boolean, if pickup is required
    /* Next fields are not required */
    'require_insurance'               => '1', // Boolean, if you need to insure a cargo
    'insurance_price'                 => '100.50', // Total cargo cost to insure
    'arrival_service'                 => [
        'enabled'                     => '1', // Enable additional service on arrival
        'arrival_service.floor'       => '10', // Floor to deliver
        'arrival_service.distance'    => '10', // Distance in Meters to deliver
        'arrival_service.elevator'    => '1', // Boolean, if there is an elevator
    ],
    'derival_service'                 => [
        'enabled'                     => '0', // Enable additional service on derival
        'floor'                       => '10', // Pickup floor
        'distance'                    => '10', // Pickup Distance in Meters
        'elevator'                    => '1', // Boolean, if there is an elevator
    ]
    /* --- */
    'cargo'                           => [ // It's an array of arrays with cargo data
      [
          'width'                     => '1', // Width in Meters
          'height'                    => '1', // Height in Meters
          'weight'                    => '1', // Weight in KG
          'volume'                    => '1', // Weight in M3
          'max_size'                  => '1', // Max dimension size in Meters
          /* Next fileds are not required */
          'protective_package'        => '1', // Boolean, if you need a protective package
          'total_sealing_positions'   => '4', // Total sealing positions
          'oversized'                 => '1', // Boolean, if cargo is oversized
          /* --- */
      ]
    ]
])
```

### Use Case #2

[](#use-case-2)

There are some predefined routes, that will be merged with your routes as well. You may check it by using

```
php artisan routes:list
```

It actually exposes the same methods to the routes, so it should be pretty clear on how to use it. For more information on how to use it, please check out `src/` folder.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance47

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

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

Recently: every ~252 days

Total

8

Last Release

878d ago

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

v1.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/978bd841bc42fd031fb568f25fd9d48f9a565770818a646c73f3801263bb7e21?d=identicon)[sergeevpasha](/maintainers/sergeevpasha)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![sergeevpasha](https://avatars.githubusercontent.com/u/30777415?v=4)](https://github.com/sergeevpasha "sergeevpasha (2 commits)")[![smotim](https://avatars.githubusercontent.com/u/57951811?v=4)](https://github.com/smotim "smotim (1 commits)")

---

Tags

laravelpecom

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sergeevpasha-laravel-pecom/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)[spinen/laravel-clickup

SPINEN's Laravel Package for ClickUp.

282.2k](/packages/spinen-laravel-clickup)

PHPackages © 2026

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