PHP code example of susutawar / php-bpjs-bridging

1. Go to this page and download the library: Download susutawar/php-bpjs-bridging 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/ */

    

susutawar / php-bpjs-bridging example snippets




pjsBridging\Antrean\Bridging as AntreanRs;
use BpjsBridging\Config;

$konfigurasi = new Config();
$bridging = new AntreanRs($konfigurasi);

use BpjsBridging\PCare\Bridging as PCare;
use BpjsBridging\Config;

$konfigurasi = new Config();
$konfigurasi->setPCare('username', 'password', 'kodeAplikasi');
$bridging = new PCare($konfigurasi);

$reqPoli = $bridging->referensiPoli();

foreach ($reqPoli->body->list as $poli) {
    echo $poli->kdpoli . ' - ' . $poli->nmpoli;
}



pjsBridging\Antrean\Bridging as AntreanRs;
use BpjsBridging\EventBridging;
use BpjsBridging\Config;

function log(EventBridging $event) {
    $file = 'log.txt';
    $handle = fopen($file, 'a');
    $data = $event->url + " pada " + $startAt;
    fwrite($handle, $data);
    fclose($handle);
}

$konfigurasi = new Config();
$konfigurasi->addListener(log)
$bridging = new AntreanRs($konfigurasi);
bash
composer