Looking to hire Laravel developers? Try LaraJobs

laravel-pecom maintained by sergeevpasha

Description
Pecom API wrapper for Laravel
Author
Last update
2025/11/06 06:55 (dev-master)
License
Links
Downloads
1 794
Tags

Comments
comments powered by Disqus

Maintainability Test Coverage CodeFactor Generic badge Generic badge

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

You need to get Pecom API key and login. Key can be obtained in your cabinet at https://kabinet.pecom.ru/profile

Installation

Configuration

This package has a few configuration values:

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:

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

Use Case #1

After installing, you may just import the client

Now you need to initialize it:

Now we can use these methods:

Delivery Object

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

Use Case #2

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

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.