PHP code example of keel-context / sdk

1. Go to this page and download the library: Download keel-context/sdk 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/ */

    

keel-context / sdk example snippets


$keel = \App\Keel\Fleet\Keel::client('http://keel.internal:8000', 'acme-logistics', getenv('KEEL_SECRET'));
$keel->events([
    \App\Keel\Fleet\Emit::tireDepthMeasured('acme-logistics', \App\Keel\Fleet\Subjects::tire('T-9001'), new DateTimeImmutable(), 'tires', new \App\Keel\Fleet\TireDepthMeasuredPayload('MXK-4821', 'P3', 2.6)),
]);
$keel->context(\App\Keel\Fleet\Subjects::tire('T-9001'))['evaluation']['tire_critical']; // true

$keel = new \Keel\Sdk\Client('http://keel.internal:8000', 'acme-logistics', getenv('KEEL_SECRET'), timeout: 10, traceparent: $traceparent);