PHPackages                             s-patompong/laravel-hmrc-api - 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. s-patompong/laravel-hmrc-api

ActiveLibrary

s-patompong/laravel-hmrc-api
============================

v1.0.9(7y ago)04812[5 PRs](https://github.com/s-patompong/laravel-hmrc-api/pulls)MITPHP

Since Jan 30Pushed 3y agoCompare

[ Source](https://github.com/s-patompong/laravel-hmrc-api)[ Packagist](https://packagist.org/packages/s-patompong/laravel-hmrc-api)[ RSS](/packages/s-patompong-laravel-hmrc-api/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (3)Versions (26)Used By (0)

Laravel HMRC API
================

[](#laravel-hmrc-api)

[![Build Status](https://camo.githubusercontent.com/db466bbad7906e10f6e80a8d2776dae31f2ec4c7686020d611a46a6396e444a3/68747470733a2f2f7472617669732d63692e636f6d2f732d7061746f6d706f6e672f6c61726176656c2d686d72632d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/s-patompong/laravel-hmrc-api)[![StyleCI](https://camo.githubusercontent.com/807d83f2b6480f1583985ba465f9b76d2e62adf8c4a3fc3118fbb7463a552ae0/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136383330353332302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/168305320)

This project is a Laravel wrapper for  library.

How to install
--------------

[](#how-to-install)

Install this library using composer require

```
composer require s-patompong/laravel-hmrc-api

```

If you use Laravel 5.5 up, it will be automatically discovered by Laravel, if now, add this code to your config/app.php file, providers array.

```
LaravelHMRC\ServiceProvider::class

```

Then, publish the config file using `php artisan vendor:publish` command. The config will be in config/hmrc.php. After that, please specify the credentials and callback in your .env file (or hmrc.php config file).

```
HMRC_LIVE_ENV=true
HMRC_CLIENT_ID=client_id
HMRC_CLIENT_SECRET=123456789
HMRC_SERVER_TOKEN=abcdefghij
HMRC_CALLBACK_URI=http://homestead.test/callback

```

Dependencies injection
----------------------

[](#dependencies-injection)

This library utilize Laravel dependencies injection, this way you can initialize important classes without sending client id, client secret to it. For example:

```
