gbro115/gloriafood-php

PHP client for the GloriaFood API

2.0.6 2020-12-30 17:43 UTC

This package is auto-updated.

Last update: 2025-03-29 00:49:38 UTC


README

Composer ready PHP wrapper for the GloriaFood API.

Installation

The recommended way to install the library is using Composer.

  1. Add this json to your composer.json file:
{
    "require": {
        "gbro115/gloriafood-php": "<your-required-version>"
    }
}
  1. Next, run this from the command line:
composer install
  1. 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);