1. Go to this page and download the library: Download rudiullon/php-onfleet 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/ */
try {
$tasks = $onfleet->tasks->get([ "from" =>"1557936000000", "to" => "1558022400000" });
foreach ($tasks['tasks'] as $task) {
if (is_set($task['recipients'][0])) {
// Do something with the recipients
}
}
} catch (Exception $error) {
// Do something with the error
}
// DONT
try {
$workers = $onfleet->workers.get();
for ($workers as $worker) {
foreach ($worker['metadata'] as $metadataEntry) {
if ($metadataEntry['name'] === "hasFreezer" && $metadataEntry['value']) {
// Do something
}
}
}
} catch (Exception $error) {
// Do something with the error
}
// DO
try {
$workers = $onfleet->workers->matchMetadata([["name" => "hasFreezer", "type" => "boolean", "value" => true]]);
for ($workers as $worker) {
// Do something
}
} catch (Exception $error) {
// Do something with the error
}
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.