developertugrul/entegra-api

Entegra API

1.0.8 2024-02-23 13:36 UTC

This package is auto-updated.

Last update: 2024-09-23 14:50:10 UTC


README

此库用于从使用Entegra电子商务软件的公司提取产品。

安装

composer require developertugrul/entegra-api

在Kernel.php文件中添加中间件。

protected $routeMiddleware = [
    // ...
    'checkEntegraToken' => \Developertugrul\EntegraApi\Middleware\CheckToken::class,
];

在.env文件中添加entegra用户名和密码。

ENTEGRA_API_USERNAME=apitestv2@entegrabilisim.com
ENTEGRA_API_PASSWORD=apitestv2

运行迁移

php artisan vendor:publish --provider="Developertugrul\EntegraApi\EntegraApiServiceProvider" --tag="migrations"
php artisan migrate

使用

use Developertugrul\EntegraApi;

$entegra = new EntegraApi();

方法

提取产品列表

从Entegra提取产品。

$products = $entegra->products()->get();

// ID ile ürün çekme
$product = $entegra->products()->get(1);

// api_sync parametresi ile sadece api_sync=1 olan ürünleri çekme
$products = $entegra->products()->getWithParameter(1);

getCategories()

从Entegra提取分类。

$categories = $entegra->getCategories();

getBrands()

从Entegra提取品牌。

$brands = $entegra->getBrands();

getOrders()

从Entegra提取订单。

$orders = $entegra->getOrders();