App\Http\Controllers\ExampleController::getDirections PHP Method

getDirections() public method

public getDirections ( )
    public function getDirections()
    {
        /**
         * Get directions response
         */
        $d['a'] = \GoogleMaps::load('directions')->setParamByKey('origin', 'Toronto')->setParamByKey('destination', 'Montreal')->get();
        /**
         * Get html_instructions from response
         */
        $d['b'] = \GoogleMaps::load('directions')->setParam(['origin' => 'place_id:ChIJ685WIFYViEgRHlHvBbiD5nE', 'destination' => 'place_id:ChIJA01I-8YVhkgRGJb0fW4UX7Y', 'mode' => 'driving', 'waypoints' => 'Charlestown,MA|Lexington,MA', 'alternatives' => true, 'avoid' => 'ferries', 'units' => 'metric', 'region' => 'GB', 'departure_time' => 'now'])->getResponseByKey('routes.legs.steps.html_instructions');
        dd($d);
    }