PHP code example of foodcheri / routific-bundle

1. Go to this page and download the library: Download foodcheri/routific-bundle 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/ */

    

foodcheri / routific-bundle example snippets


$clientRoutific = $this->get('foodcheri_sdk_routific.client');

$problem->addVisit("order_1", array(
	"location" => array(
        "name" => "Visit1 name",
        "lat" => 49.227607,
        "lng" => -123.1363085
    ),
    "start" => "19:00",
    "end" => "19:30",
    "duration" => 5,
    "load" => 1,
    "type" => "A",
    "priority" => "high"
	)
);

$problem->addVehicle("vehicle_1", array(
	"start_location" => array(
		"id" => "hub id"
        "name" => "hub name",
        "lat" => 49.227607,
        "lng" => -123.1363085
    ),
    "end_location" => array(
		"id" => "hub id",
        "name" => "hub name",
        "lat" => 49.227607,
        "lng" => -123.1363085
    ),
    "shift_start" => "18:00",
    "shift_end" => "22:30",
    "min_visits" => 10,
    "capacity" => 20,
    "type" => ["A", "B"],
    "speed" => "bike",
    "strict_start" => true,
    "break_start" => "12:00",
    "break_end" => "13:30",
    "break_duration" => 30
	)
);

$problem->addOption(array("traffic" => "slow"));