PHP code example of gawrys / counterparty-laravel

1. Go to this page and download the library: Download gawrys/counterparty-laravel 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/ */

    

gawrys / counterparty-laravel example snippets


use Gawrys\Counterparty\Laravel\Facades\Counterparty;
use Gawrys\Counterparty\Counterparty as Subject;

$outcome = Counterparty::verify(new Subject('Acme', 'PL', nip: '1234567890'));

Counterparty::extendRegistry('de', fn () => new GermanRegistryDriver(app(JsonHttpClient::class)));

$request->validate([
    'nip'  => ['ys\Counterparty\Laravel\Rules\NotSanctioned()],
]);

\Gawrys\Counterparty\Laravel\Jobs\VerifyCounterparty::dispatch($counterparty);
// dispatches Events\CounterpartyFlagged when the outcome is adverse or needs review
bash
composer check   # php-cs-fixer + PHPStan max (larastan) + PHPUnit (orchestra/testbench)