PHPackages                             programic/laravel-distance-matrix - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. programic/laravel-distance-matrix

ActivePackage[Utility &amp; Helpers](/categories/utility)

programic/laravel-distance-matrix
=================================

Using Google Distance Matrix in Laravel

v1.2.0(1y ago)09.3k↑181%1proprietaryPHPPHP ^7.0|^8.0

Since Dec 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/programic/laravel-distance-matrix)[ Packagist](https://packagist.org/packages/programic/laravel-distance-matrix)[ RSS](/packages/programic-laravel-distance-matrix/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (1)Versions (7)Used By (0)

Programic - Google Distance matrix
==================================

[](#programic---google-distance-matrix)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3c93bf4ae1d834188654bb8a53476d9a2151f68f21288bc6255863fe6c7c3b59/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6772616d69632f6c61726176656c2d64697374616e63652d6d61747269782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/programic/laravel-distance-matrix)[![](https://github.com/programic/laravel-distance-matrix/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/programic/laravel-distance-matrix/workflows/Run%20Tests/badge.svg?branch=master)[![Total Downloads](https://camo.githubusercontent.com/bf8e4dbe2d81708b512e6de37495756f6cb73bd98e4e4931748ddfb6afdc53e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70726f6772616d69632f6c61726176656c2d64697374616e63652d6d61747269782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/programic/laravel-distance-matrix)

This package allows you to use get simple the duration and distance between two addresses by the Google Distance Matrix API

### Installation

[](#installation)

This package requires PHP 7.2 and Laravel 5.8 or higher.

```
composer require programic/laravel-distance-matrix

```

### Basic Usage

[](#basic-usage)

```
use \Programic\DistanceMatrix\DistanceMatrix

class DistanceController {

    public function index(DistanceMatrix $distanceMatrix)
    {
        $response = $distanceMatrix->from($from)->to($to)->calculate();

        $distance = $response->toArray();
    }

}
```

### Available Exceptions

[](#available-exceptions)

See the Exceptions folder for more information. Except for the InvalidKeyException, these Exceptions are all taken from the [Google Distance Matrix API documentation](https://developers.google.com/maps/documentation/distance-matrix/distance-matrix#DistanceMatrixStatus).

```
use Programic\DistanceMatrix\Exceptions\InvalidKeyException;
use Programic\DistanceMatrix\Exceptions\InvalidRequestException;
use Programic\DistanceMatrix\Exceptions\MaxDimensionsExceededException;
use Programic\DistanceMatrix\Exceptions\MaxElementsExceededException;
use Programic\DistanceMatrix\Exceptions\OverDailyLimitException;
use Programic\DistanceMatrix\Exceptions\OverQueryLimitException;
use Programic\DistanceMatrix\Exceptions\RequestDeniedException;
use Programic\DistanceMatrix\Exceptions\UnknownErrorException;
```

### 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)

- [Rick Bongers](https://github.com/rbongers)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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 ~203 days

Recently: every ~239 days

Total

6

Last Release

633d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04de5632caf547d8dfa4ffbfac25d0538f92f1e9d52d2f91a2d1d6f17a9561a5?d=identicon)[Programic](/maintainers/Programic)

---

Top Contributors

[![rick-bongers](https://avatars.githubusercontent.com/u/67374906?v=4)](https://github.com/rick-bongers "rick-bongers (7 commits)")[![Peter-Programic](https://avatars.githubusercontent.com/u/117899309?v=4)](https://github.com/Peter-Programic "Peter-Programic (3 commits)")

### Embed Badge

![Health badge](/badges/programic-laravel-distance-matrix/health.svg)

```
[![Health](https://phpackages.com/badges/programic-laravel-distance-matrix/health.svg)](https://phpackages.com/packages/programic-laravel-distance-matrix)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.7k1](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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