Projeto para integração com o sistema do Ifood.
"matheushack/ifood": "dev-master"
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Categories;
use MatheusHack\IFood\Constants\Availability;
$categories = new Categories();
$categories->create([
'externalCode' => 'CAT001',
'name' => 'Lanches',
'order' => 1,
'status' => Availability::ACTIVE
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\GroupComplements;
$groupComplement = new GroupComplements();
$groupComplement->create([
'externalCode' => 'GRP001',
'name' => 'Bebida',
'sequence' => 1,
'minQuantity' => 1,
'maxQuantity' => 1
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Items;
use MatheusHack\IFood\Constants\DaysOfWeek;
use MatheusHack\IFood\Constants\Availability;
$items = new Items();
$items->create([
'externalCode' => 'ITP001',
'name' => 'Hack X-burguer',
'order' => 1,
'status' => Availability::ACTIVE,
'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod',
'price' => [
'amount' => 1,
'isPromotional' => false
],
'schedules' => [DaysOfWeek::MON, DaysOfWeek::TUE, DaysOfWeek::WED, DaysOfWeek::THU, DaysOfWeek::FRI]
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Items;
use MatheusHack\IFood\Constants\Availability;
$items = new Items();
$items->create([
'externalCode' => 'ITS001',
'name' => 'Coca-cola',
'order' => 1,
'status' => Availability::ACTIVE,
'description' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod',
'price' => [
'amount' => 2,
'isPromotional' => false
],
'schedules' => []
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Items;
$items = new Items();
$items->joinGroup([
'externalCodeGroup' => 'GRP001',
'externalCodeItem' => 'ITS001',
'sequence' => 1
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\GroupComplements;
$groupComplement = new GroupComplements();
$groupComplement->joinItem([
'externalCodeGroup' => 'GRP001',
'externalCodeItem' => 'ITP001',
'maxQuantity' => 1,
'minQuantity' => 1,
'order' => 1
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Items;
$items = new Items();
$items->joinCategory([
'externalCode' => 'ITP001',
'externalCodeCategory' => 'CAT001',
'order' => 1
]);
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Restaurant;
$restaurant = new Restaurant();
$restaurant->available();
<?php
require_once('vendor/autoload.php');
use MatheusHack\IFood\Restaurant;
$restaurant = new Restaurant();
$restaurant->unavailable('MOTIVO');