c6digital/mapit-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

c6digital/mapit-php

最新稳定版本:v0.2.0

Composer 安装命令:

composer require c6digital/mapit-php

包简介

Third-party PHP SDK for MapIt.

README 文档

README

Latest Version on Packagist Tests Total Downloads

This package provides a lightweight SDK to interact with MapIt APIs. It doesn't have methods for everything, only the things that we as an organisation frequently use.

Installation

You can install the package via Composer:

composer require c6digital/mapit-php

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

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

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

Throwing when errors occur

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

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 772
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-06