gbro115 / gloriafood-php
PHP client for the GloriaFood API
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 4
Open Issues: 0
Type:project
Requires
- php: ^7.3
- ext-json: *
- guzzlehttp/guzzle: ^6.5|^7.0
- nesbot/carbon: ^2.17.0
- psr/log: ^1.0.1
Requires (Dev)
- phpunit/phpunit: ^9
README
Composer ready PHP wrapper for the GloriaFood API.
Installation
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';
Functionality offered by this package
- Retrieve a menu from the GloriaFood Fetch Menu API
- Parse the JSON body of an Accepted Orders payload into an object
Handling Exceptions
If the API returns an error or an unexpected response, the PHP API will throw a \GloriaFood\Exception.
Example usage
<?php require 'vendor/autoload.php'; $authKey = "SOURCED_FROM_WEB_APP"; $api = new \GloriaFood\GloriaFood($authKey); $result = $api->fetchMenu()->fetchMenu(); print_r($result);