1. Go to this page and download the library: Download almesery/laravel-foodics 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/ */
use Foodics\Services\FoodicsRedirectServices;
$foodicsOAuthServices = new FoodicsRedirectServices();
return $foodicsOAuthServices->redirect();
// you will redirect to [FOODICS_REDIRECT_URI], the url contain code as a query parameter
use Foodics\Services\FoodicsAuthorizationServices;
$foodicsAuthorizationServices = new FoodicsAuthorizationServices();
// $code variable you can get from the previous request
$response = $foodicsOAuthServices->authorize($code);
$access_token = $response["access_token"];
use Foodics\Foodics;
$foodics = new Foodics($access_token);
$data = $foodics->settings()->whoami();
echo $data;