unopim/bagisto-rest-api 问题修复 & 功能扩展

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

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

unopim/bagisto-rest-api

Composer 安装命令:

composer require unopim/bagisto-rest-api

包简介

README 文档

README

Bagisto REST API is a medium to use the features of the core Bagisto system. By using the Bagisto REST API, you can integrate your application to serve the default content of Bagisto.

1. Requirements

  • Bagisto: v2.4.x
  • PHP: ^8.3

2. Installation

Option A — Composer (recommended)

Install the package via Composer:

composer require unopim/bagisto-rest-api

Option B — Manual (place the package in packages/Webkul)

Use this when you want to keep the package source inside your project (for example, a fork you maintain).

  1. Put the package source in packages/Webkul/RestApi:

    git clone https://github.com/unopim/bagisto-rest-api.git packages/Webkul/RestApi
    rm -rf packages/Webkul/RestApi/.git
  2. Register the namespace in the root composer.json under autoload.psr-4:

    "Webkul\\RestApi\\": "packages/Webkul/RestApi/src"
  3. Register the service provider in bootstrap/providers.php:

    Webkul\RestApi\Providers\RestApiServiceProvider::class,
  4. Install the L5-Swagger dependency and refresh the autoloader:

    composer require darkaonline/l5-swagger:^8.5
    composer dump-autoload

Configure (both options)

Add your application's domain to the .env file so Sanctum can authenticate stateful requests. Use the host only (optionally host:port) — do not include the scheme or path:

SANCTUM_STATEFUL_DOMAINS=localhost

Publish the L5-Swagger configuration and generate the API documentation:

php artisan bagisto-rest-api:install

Manual install only: because the package lives in packages/Webkul/RestApi (not vendor/), open the published config/l5-swagger.php and change the annotation paths from base_path('vendor/unopim/bagisto-rest-api/src/Docs/...') to base_path('packages/Webkul/RestApi/src/Docs/...'), then regenerate the docs: php artisan l5-swagger:generate --all.

Clear the caches:

php artisan optimize:clear

3. API Documentation

Open the following URLs in your browser (replace the host with your application's URL):

  • Admin: http://localhost/api/admin/documentation
  • Shop: http://localhost/api/shop/documentation

4. Bulk Product API (Queues)

The Bulk Product API processes products asynchronously through the queue. Set the queue connection in your .env:

QUEUE_CONNECTION=database

Then run a queue worker so the dispatched bulk jobs are processed:

php artisan queue:work

See the L5-Swagger documentation for more details on configuring the API documentation.

unopim/bagisto-rest-api 适用场景与选型建议

unopim/bagisto-rest-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 84 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 01 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 unopim/bagisto-rest-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 unopim/bagisto-rest-api 我们能提供哪些服务?
定制开发 / 二次开发

基于 unopim/bagisto-rest-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-21