PHP code example of s-patompong / laravel-hmrc-api

1. Go to this page and download the library: Download s-patompong/laravel-hmrc-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

s-patompong / laravel-hmrc-api example snippets




namespace App\Http\Controllers;

use HMRC\Environment\Environment;
use HMRC\ServerToken\ServerToken;
use Illuminate\Http\Request;
use LaravelHMRC\LaravelHMRC;

class HMRCAPIController extends Controller
{
    private $hmrcService;

    private $environment;

    private $serverToken;

    public function __construct(LaravelHMRC $hmrcService, Environment $environment, ServerToken $serverToken)
    {
        $this->hmrcService = $hmrcService;
        $this->environment = $environment;
        $this->serverToken = $serverToken;
    }

    public function index(Request $request)
    {
        dd($this->hmrcService, $this->environment, $this->serverToken);
    }
}