PHPackages                             shayanizadi/routific - 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. shayanizadi/routific

ActiveLibrary[API Development](/categories/api)

shayanizadi/routific
====================

PHP library for the Routific API

v0.3.0(1y ago)34MITPHPPHP &gt;=7.2

Since Dec 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/shayan-izadi/routific-php)[ Packagist](https://packagist.org/packages/shayanizadi/routific)[ RSS](/packages/shayanizadi-routific/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Routific PHP
============

[](#routific-php)

The Routific PHP library provides convenient access to the Routific API from applications written in the PHP language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

Requirements
------------

[](#requirements)

PHP 7.2.0 and later.

Composer
--------

[](#composer)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require shayanizadi/routific
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Getting Started
---------------

[](#getting-started)

Simply set your [Routific API key](https://docs.routific.com/reference/get-your-api-key):

```
$routific= new \Routific\ApiClient;
$routific->setApiKey('YOUR_API_KEY');
```

Documentation
-------------

[](#documentation)

See the [Routific API docs](https://docs.routific.com/reference/api-reference).

SET VISITS
----------

[](#set-visits)

First step you must set up your visit endpoints :

```
$order1 = array(
    "location" => array(
      "name" => "6800 Cambie",
      "lat" => 49.227107,
      "lng" => -123.1163085
));
$order2 = array(
    "location" => array(
      "name" => "3780 Arbutus",
      "lat" => 49.2474624,
      "lng" => -123.1532338
));
$order3 = array(
    "location" => array(
      "name" => "800 Robson",
      "lat" => 49.2819229,
      "lng" => -123.1211844
));
$visits = array(
    "order_1" => $order1,
    "order_2" => $order2,
    "order_3" => $order3
);

$routific->setVisits($visits);
```

SET VEHICLES
------------

[](#set-vehicles)

Then you can define your vehicles (drivers) :

```
$vehicle1 = array(
    "start_location" => array(
      "id" => "depot",
      "name" => "800 Kingsway",
      "lat" => 49.2553636,
      "lng" => -123.0873365
));

$vehicle2 = array(
    "start_location" => array(
      "id" => "depot",
      "name" => "800 Kingsway",
      "lat" => 49.2553636,
      "lng" => -123.0873365
));

$vehicles = array(
    "vehicle_1" => $vehicle1,
    "vehicle_2" => $vehicle2,
);

$routific->setVehicles($vehicles);
```

Optimize Route for Vehicle Routing
----------------------------------

[](#optimize-route-for-vehicle-routing)

Now you can choose based on your purpose to use API that suits your situation

If you want use just vehicle routing optimization:

```
$routific->vehicleApi->optimizeRoute();
```

Optimize Route for Pickup &amp; Delivery
----------------------------------------

[](#optimize-route-for-pickup--delivery)

If you are looking for Pickup and Delivery optimizer :

```
$routific->pickupDelivery->optimizeRoute();
```

Use Long Running tasks API
--------------------------

[](#use-long-running-tasks-api)

If you wish to use [Long Running Tasks Api](https://docs.routific.com/reference/vrp-long), you have to simply set input for optimizeRoute as TRUE:

```
$key=$routific->vehicleApi->optimizeRoute(TRUE);
 //OR
$key=$routific->pickupDelivery->optimizeRoute(TRUE);
```

Then you have to retrieve job that has been created:

```
$routific->jobApi->getJobDetails($key['job_id'])
```

For running tests
-----------------

[](#for-running-tests)

If you wish to run tests, first you must change composer in this way:

```
"autoload": {
        "psr-4": {
            "ShayanIzadi\\Routific\\": "lib/"
        }
    },

 //to

"autoload": {
        "psr-4": {
            "Routific\\": "lib/"
        }
    },
```

Then run dump autoload command

```
   composer dump-autoload
```

Appreciate Contributions
------------------------

[](#appreciate-contributions)

We welcome contributions from everyone! If you'd like to contribute to this project, follow these steps:

1- Fork the repository. 2- Create a new branch for your feature or bug fix 3- Commit your changes and push your branch 4- Open a pull request and explain your changes.

Your contributions will help make this project even better. Thank you for your support!

License
-------

[](#license)

This project is licensed under the MIT License. You are free to use, modify, and distribute this project as long as you include the original license file. For more details, see the [LICENSE file](https://github.com/shayan-izadi/routific-php/blob/main/LICENSE) .

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance43

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 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 ~21 days

Total

4

Last Release

450d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b1fc7715e723f19e5e837b3ab246e822dbe9e14a3decdc9491735f29973855d?d=identicon)[shayan-izadi](/maintainers/shayan-izadi)

---

Top Contributors

[![shayan-izadi](https://avatars.githubusercontent.com/u/104488218?v=4)](https://github.com/shayan-izadi "shayan-izadi (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shayanizadi-routific/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)

PHPackages © 2026

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