定制 daygarcia/laravel-vtex 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

daygarcia/laravel-vtex

Composer 安装命令:

composer require daygarcia/laravel-vtex

包简介

A laravel package to help you to connect to VTEX API

README 文档

README

A package to connect to VTEX API

Requirements

PHP 8 and later

Installation & Usage

Composer

To install via composer:

composer require daygarcia/laravel-vtex

Setup

The Configuration constructor takes a single argument: an array containing all configuration needed to connect to VTEX API:

<?php

// Still under development

use Illuminate\Http\Request;
use LaravelVtex\Configuration;

...

$config = new Configuration([
    'app_token'   => config('vtex.app_token'),
    'app_key'     => config('vtex.app_key'),
    'store_name'  => config('vtex.store_name')
]);

Getter and setter methods are available for the Configuration class. You can directly get and set app_token, app_key and store_name

Example

<?php

use LaravelVtex\Configuration;
use LaravelVtex\Api\PromotionApi;

...

public function index(Request $request)
{
    $config = new Configuration([
        'app_token'   => config('vtex.app_token'),
        'app_key'     => config('vtex.app_key'),
        'store_name'  => config('vtex.store_name')
    ]);

    try {
        $vtex = new PromotionAndTaxesApi($config);
        $response = $vtex->getAllPromotions();

        return $this->success($response);
    } catch (Exception $e) {
        return $this->error($e->getMessage(), $e->getCode());
    }
}

Documentation & Important notes

Don’t forget to check out VTEX developer website developer site

TODO

  • Improve error handling

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固