zatona-eg/zatona-eg-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

zatona-eg/zatona-eg-api

Composer 安装命令:

composer require zatona-eg/zatona-eg-api

包简介

zatona-eg API Platform package with GraphQL and REST API support

README 文档

README

Comprehensive REST and GraphQL APIs for seamless e-commerce integration and extensibility.

Requirements

  • PHP 8.3+
  • Bagisto v2.3.8 (the version this package is tested against in CI)
  • Composer 2
  • MySQL 8.0+ or PostgreSQL 14+
  • API Platform for Laravel — a pinned, consistent set of api-platform/* packages (laravel v4.1.25, graphql v4.2.3, core components v4.3.1) installed automatically via composer require

Installation

Method 1: Quick Start (Composer Installation – Recommended)

The fastest way to get started:

composer require zatona-eg/zatona-eg-api
php artisan bagisto-api-platform:install

Your APIs are now ready! Access them at:

  • API Landing: https://your-domain.com/api
  • REST API Docs (Shop): https://your-domain.com/api/shop/docs
  • REST API Docs (Admin): https://your-domain.com/api/admin/docs
  • GraphQL Playground (Shop): https://your-domain.com/api/graphiql
  • GraphQL Playground (Admin): https://your-domain.com/api/admin/graphiql

Method 2: Manual Installation

Use this method if you need more control over the setup.

Step 1: Download and Extract

  1. Download the BagistoApi package from GitHub
  2. Extract it to: packages/Webkul/BagistoApi/

Step 2: Register Service Provider

Edit bootstrap/providers.php:

<?php

return [
    // ...existing providers...
    Webkul\BagistoApi\Providers\BagistoApiServiceProvider::class,
    // ...rest of providers...
];

Step 3: Update Autoloading

Edit composer.json and update the autoload section:

{
  "autoload": {
    "psr-4": {
      "Webkul\\BagistoApi\\": "packages/Webkul/BagistoApi/src"
    }
  }
}

Step 4: Install Dependencies

# Install required packages (pin the API Platform components to a consistent set)
composer require \
  api-platform/laravel:v4.1.25 \
  api-platform/graphql:v4.2.3 \
  api-platform/metadata:v4.3.1 \
  api-platform/serializer:v4.3.1 \
  api-platform/state:v4.3.1 \
  api-platform/jsonld:v4.3.1 \
  api-platform/hydra:v4.3.1 \
  api-platform/openapi:v4.3.1 \
  api-platform/json-schema:v4.3.1 \
  api-platform/json-api:v4.3.1 \
  api-platform/documentation:v4.3.1

Step 5: Run the installation

php artisan bagisto-api-platform:install

Step 6: Environment Setup (Update in the .env)

STOREFRONT_DEFAULT_RATE_LIMIT=100
STOREFRONT_CACHE_TTL=60
STOREFRONT_KEY_PREFIX=storefront_key_
STOREFRONT_PLAYGROUND_KEY=pk_storefront_xxxxxxxxxxxxxxxxxxxxxxxxxx 
API_PLAYGROUND_AUTO_INJECT_STOREFRONT_KEY=true

Access Points

Once verified, access the APIs at:

Admin API Authentication

Admin endpoints (/api/admin/* and /api/admin/graphql) require an integration-token Bearer header:

Authorization: Bearer id|generated-token

To generate a token:

  1. Log into the Bagisto admin panel.
  2. Enable the module first: navigate to Configuration → API → Integration → Module Settings and turn Enabled on. (Without this, the Integration menu stays hidden.)
  3. Navigate to Settings → Integration.
  4. Click Create, fill in the name / description / assigned admin / permission mode (All, Custom, or Same as Web) / optional IP allowlist / rate limits / expiry, and save as a draft.
  5. Click Generate. The plaintext token is shown once — copy it immediately. You won't be able to view it again; if lost, use Regenerate to issue a new one.

Each token is scoped to a single admin user and inherits that admin's role permissions — so tokens can never do more than their owner could in the admin UI. To issue tokens to multiple admins, create one token per admin (each admin can hold only one active token at a time).

Tokens can be revoked at any time from the same page or via the signed link in the lifecycle notification email sent to the token owner.

Documentation

Support

For issues and questions, please visit:

📝 License

The zatona-eg API Platform is open-source software licensed under the MIT license.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固