PHPackages                             c6digital/mapit-php - 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. c6digital/mapit-php

ActiveLibrary[API Development](/categories/api)

c6digital/mapit-php
===================

Third-party PHP SDK for MapIt.

v0.2.0(7mo ago)1907↓50%[2 PRs](https://github.com/c6digital/mapit-php/pulls)MITPHPPHP ^8.2CI passing

Since Apr 26Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/c6digital/mapit-php)[ Packagist](https://packagist.org/packages/c6digital/mapit-php)[ Docs](https://github.com/c6digital/mapit-php)[ GitHub Sponsors](https://github.com/c6digital)[ RSS](/packages/c6digital-mapit-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (5)Versions (7)Used By (0)

Third-party PHP SDK for MapIt.
==============================

[](#third-party-php-sdk-for-mapit)

[![Latest Version on Packagist](https://camo.githubusercontent.com/61daccd270c5e26de80d8258e55988b91c2c93f379e9301530ed07b5026f93f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63366469676974616c2f6d617069742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/c6digital/mapit-php)[![Tests](https://camo.githubusercontent.com/42989abe583093774b7d9040ac6162d11da019d85787de549b0b0964042f0cdc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63366469676974616c2f6d617069742d7068702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/c6digital/mapit-php/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/fc6fbf7d98036b29c0882d381ce6e1f1647d2c4219855c9c8181217a223f3c3d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63366469676974616c2f6d617069742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/c6digital/mapit-php)

This package provides a lightweight SDK to interact with [MapIt](https://mapit.mysociety.org/) APIs. It doesn't have methods for everything, only the things that we as an organisation frequently use.

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

[](#installation)

You can install the package via Composer:

```
composer require c6digital/mapit-php
```

Usage
-----

[](#usage)

```
use C6Digital\MapIt\MapIt;

$mapIt = new MapIt(
    key: 'your-mapit-key-here',          // Your MapIt API key / token.
    url: 'https://mapit.mysociety.org'  // An optional MapIt URL.
);
```

### Laravel

[](#laravel)

If you're using Laravel, this package provides a service provider that automatically registers the `MapIt` class and uses `.env` variables to configure the key and URL.

```
MAPIT_KEY=...
MAPIT_URL=...
```

You can then request it from the container when you need to use it.

```
use C6Digital\MapIt\MapIt;

class MyController
{
    public function __invoke(MapIt $mapIt)
    {
        // ...
    }
}
```

### Retrieving postcodes

[](#retrieving-postcodes)

```
$mapIt->postcode('SW1P 3BD');
```

### Throwing when errors occur

[](#throwing-when-errors-occur)

```
$mapIt->throw()->postcode(...);
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Ryan Chandler](https://github.com/c6digital)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance72

Regular maintenance activity

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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

Total

4

Last Release

214d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/568d485d441c691b0358b9091254a6a671fef8f76b73f28af1180ad568d142b2?d=identicon)[ryangjchandler](/maintainers/ryangjchandler)

---

Top Contributors

[![ryangjchandler](https://avatars.githubusercontent.com/u/41837763?v=4)](https://github.com/ryangjchandler "ryangjchandler (15 commits)")[![c6andy](https://avatars.githubusercontent.com/u/213634680?v=4)](https://github.com/c6andy "c6andy (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

c6digitalmapit-php

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/c6digital-mapit-php/health.svg)

```
[![Health](https://phpackages.com/badges/c6digital-mapit-php/health.svg)](https://phpackages.com/packages/c6digital-mapit-php)
```

###  Alternatives

[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[spatie/spatie-price-api

The Price API used at promotional sites for our own products

1515.1k1](/packages/spatie-spatie-price-api)[dragon-code/laravel-json-response

Automatically always return a response in JSON format

1118.6k1](/packages/dragon-code-laravel-json-response)

PHPackages © 2026

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