PHP code example of patrixshah-uk-vat-checker / hmrc-vat-check

1. Go to this page and download the library: Download patrixshah-uk-vat-checker/hmrc-vat-check 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/ */

    

patrixshah-uk-vat-checker / hmrc-vat-check example snippets


    use Illuminate\Support\Facades\Route;
    use YourVendorName\HmrcVatCheck\Controllers\VatCheckController;
    Route::post('/api/vat/check', [VatCheckController::class, 'checkVatNumber']);
    

return [
    'client_id' => env('HMRC_CLIENT_ID', 'your-client-id'),
    'client_secret' => env('HMRC_CLIENT_SECRET', 'your-client-secret'),
    'oauth2_url' => env('HMRC_OAUTH2_URL', 'https://test-api.service.hmrc.gov.uk/oauth/token'),
    'grant_type' => env('HMRC_GRANT_TYPE', 'client_credentials'),
    'scope' => env('HMRC_SCOPE', 'read:vat'),
    'check_vat_number_url' => env('HMRC_CHECK_VAT_NUMBER', 'https://test-api.service.hmrc.gov.uk/organisations/vat/check-vat-number/lookup'),
];
bash
    php artisan vendor:publish --provider="PatrixshahUKVatChecker\HmrcVatCheck\HmrcVatCheckServiceProvider" --tag=config
    
bash
    php artisan config:clear