1. Go to this page and download the library: Download upgradelabs/tcpos 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 TCPOS;
// Retrieve shop list
$shops = TCPOS::getShops();
// Fetch configuration for shop ID 5 as of today
$config = TCPOS::getShopConfiguration(5, now()->toIso8601String());
// List articles for shop ID 5, group ID 2, page 1
$articles = TCPOS::getArticles(5, 2, 50, 1);
use Upgradelabs\TCPOS\Client;
class OrderController extends Controller
{
protected Client $tcpos;
public function __construct(Client $tcpos)
{
$this->tcpos = $tcpos;
}
public function index()
{
return $this->tcpos->getShops();
}
}