PHPackages                             eduardosp6/router-tool - 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. [Framework](/categories/framework)
4. /
5. eduardosp6/router-tool

ActiveLibrary[Framework](/categories/framework)

eduardosp6/router-tool
======================

Routing solution package for Laravel projects

011PHP

Since Sep 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/EduardoSP6/router-tool)[ Packagist](https://packagist.org/packages/eduardosp6/router-tool)[ RSS](/packages/eduardosp6-router-tool/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

RouterTool
==========

[](#routertool)

#### Author: Eduardo Sales

[](#author-eduardo-sales)

#### Created At: 14/09/2022

[](#created-at-14092022)

##### This package aims to standardize routing and geocoding routines, using market providers.

[](#this-package-aims-to-standardize-routing-and-geocoding-routines-using-market-providers)

##### Supported providers: Google and TomTom.

[](#supported-providers-google-and-tomtom)

### Prerequisites:

[](#prerequisites)

```
- PHP 7.4 or above;
- Larvel 7.x or above;

```

### Installation:

[](#installation)

```
- Composer:
    $ composer require eduardosp6/router-tool

- Publish config file:

    $ php artisan vendor:publish --provider=Eduardosp6\RouterTool\RouterToolServiceProvider --tag=config

- Insert your API key in config file for the provider do you will use.

```

### Classes Diagram:

[](#classes-diagram)

```
Geocode - Class responsible for transforming address into geographic coordinates.

RouterTool - Class for build the routes.

Providers - Classes of providers.

Services - Consumption classes of provider APIs.
Adapt the methods according to your project.

Hierarchy:

- RouterTool
    - Provider
        - Client

```

### Use cases:

[](#use-cases)

#### Geocoding:

[](#geocoding)

```
For geocoding just call the static method Geocode::exec() passing the parameters:
Full address (avoid abbreviations), neighborhood and city.
This method sends a request to TomTom and if the neighborhood
and city is not compatible, send it to Google.

The return will be an array containing the latitude and longitude keys
of the address if successful, otherwise it will be null.

$coords = Geocode::exec(
        "Av. Rio Branco, 15000 Centro, Rio de Janeiro - RJ"
        , "Centro",
        "Rio de Janeiro"
    );

```

#### Routing:

[](#routing)

##### Attention! Using Google as a provider, in generating the route, the maximum number of points is 23

[](#attention-using-google-as-a-provider-in-generating-the-route-the-maximum-number-of-points-is-23)

```
// Create a new instance
$routerTool = new RouterTool();

// Define the provider. Available: TomTomAPI or GoogleAPI
$routerTool->setProvider(new TomTomAPI());

// Routing calc:
// params: route data array, expected exit date (Carbon instance), routing mode
// mode param:
// normal - Normal mode (keeps the given sequence of deliveries)
// optimized - Optimized mode (Edit the sequence of deliveries for better performance, ditance and duration).

// returns: the same array sent as parameter but filled with routing data.

// Example:

// route array structure
$route = [
    'distance_total' => 0.0,
    'duration_total'=> 0.0,
    'start_point' => [
        'id' => '1',
        'latitude' => 22.3489343,
        'longitude' => 43.998509
    ],
    'steps' => [
        [
            'id' => 112,
            'order' => 1,
            'type' => 'delivery', // accepted values: delivery, collect, deposit
            'latitude' => 22.834783,
            'longitude' => 43.48729,
            'address' => '',
            'number' => null,
            'district' => '',
            'city' => '',
            'uf' => '',
            'date_arrival' => '',
            'time_arrival' => '',
            'time_service' => '',
            'time_course' => '',
            'distance' => 0,
        ]
    ]
]

$result = $routerTool->performRouting($route, $exitDate);

dump($result);

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

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.

### Community

Maintainers

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

---

Top Contributors

[![EduardoSP6](https://avatars.githubusercontent.com/u/18709290?v=4)](https://github.com/EduardoSP6 "EduardoSP6 (13 commits)")

### Embed Badge

![Health badge](/badges/eduardosp6-router-tool/health.svg)

```
[![Health](https://phpackages.com/badges/eduardosp6-router-tool/health.svg)](https://phpackages.com/packages/eduardosp6-router-tool)
```

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M190](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M255](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M591](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M120](/packages/cakephp-chronos)

PHPackages © 2026

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