PHPackages                             hmrc/mtd - 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. hmrc/mtd

ActiveLibrary

hmrc/mtd
========

1302PHP

Since Feb 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dhavalbhavsar/hmrcmtd)[ Packagist](https://packagist.org/packages/hmrc/mtd)[ RSS](/packages/hmrc-mtd/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel HmrcMtd
===============

[](#laravel-hmrcmtd)

Hmrc Mtd

Insiperd by [ecoofficekbo - HmrcMtd](https://github.com/ecoofficekbo/hmrcmtd)

Update
======

[](#update)

Remove minor modification of header var\_dump in each request

HmrcMtd
=======

[](#hmrcmtd)

PHP component for accessing the new HMRC MTD API. Focused initially on VAT which is currently in beta, but will be mandatory to use from April 2019 for businesses over the VAT threshold

Running The Tests
-----------------

[](#running-the-tests)

Copy the `.env.example` file into `.env` and paste your `CLIENT_ID`, `CLIENT_SECRET` AND `SERVER_TOKEN` as provided by HMRC

To begin, first ensure you have created a test user:

```
$vat = new HmrcVat();
$vat->createTestUser();

```

Enter the returned vrn value into the `VAT_REGISTRATION_NUMBER` in the .env file. Save the userId and password for the next steps

```
VAT_REGISTRATION_NUMBER="paste-vrn-here"

```

Execute tests/AuthTestCase.php

```
vendor\bin\phpunit tests/AuthTestCase.php

```

The output will give you a URI to copy and paste into your browser. Then you will need to log into the HMRC test platform with the userId and password from the previous step. At the end of the process, it will give you an authorisation code to copy and paste into your .env file

```
AUTHORISATION_CODE="paste-authorisation-code-here"

```

Finally you can run all the tests. This process will create a file called tests/auth to save the `access_token` and `refresh_token` for future use

```
vendor\bin\phpunit

```

License
-------

[](#license)

This project is licensed under the GNU GPLv3 License - see the [License](License) file for more details

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity16

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/d5fbc9a969ac2e7790e24d884498a871155ca94ba99cfc9e9f2a3c26a3af6a9a?d=identicon)[hdbhavsar91](/maintainers/hdbhavsar91)

---

Top Contributors

[![dhavalbhavsar](https://avatars.githubusercontent.com/u/22841292?v=4)](https://github.com/dhavalbhavsar "dhavalbhavsar (11 commits)")

### Embed Badge

![Health badge](/badges/hmrc-mtd/health.svg)

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

PHPackages © 2026

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