Composer ready PHP wrapper for the GloriaFood API.
The recommended way to install the library is using Composer.
- Add this json to your composer.json file:
{
"require": {
"gbro115/gloriafood-php": "<your-required-version>"
}
}
- Next, run this from the command line:
composer install
- Finally, add this line to your php file that will be using the SDK:
require 'vendor/autoload.php';
- Retrieve a menu from the GloriaFood Fetch Menu API
- Parse the JSON body of an Accepted Orders payload into an object
If the API returns an error or an unexpected response, the PHP API will throw a \GloriaFood\Exception.
<?php
require 'vendor/autoload.php';
$authKey = "SOURCED_FROM_WEB_APP";
$api = new \GloriaFood\GloriaFood($authKey);
$result = $api->fetchMenu()->fetchMenu();
print_r($result);