boaideas/laravel-shopify
Composer 安装命令:
composer require boaideas/laravel-shopify
包简介
An easier to use rocket-code/shopify for Shopify integration in Laravel applications
README 文档
README
This packages allows for a better integration of rocket-code/shopify in Laravel applications.
Benefits
By using this package you get these added values:
- Auto discovery (Laravel 5.5 or higher) - no need to manually add any service provider
- Configuration in env file
- Allow the service to be used in dependency injection
- Allow usage as real time facade (Laravel 5.4 or higher)
Installation
You can install the package via composer:
composer require boaideas/laravel-shopify
If you're installing the package on Laravel 5.5 or higher, you're done (The package uses Laravel's auto package discovery).
If you're using Laravel 5.4 or less, add the BOAIdeas\Shopify\ShopifyServiceProvider service provider to your providers array:
// config/app.php 'providers' => [ ... BOAIdeas\Shopify\ShopifyServiceProvider::class, ];
Configuration
Now, by default, the package will look for the following values in your .env file:
// .env
SHOPIFY_KEY=YourAppApiKey
SHOPIFY_SECRET=YourAppSecret
SHOPIFY_DOMAIN=YourShopDomain (for private apps)
SHOPIFY_TOKEN=YourToken
If, for some reason, you want to change any of these settings, you can publish the config file with:
php artisan vendor:publish --provider="BOAIdeas\Shopify\ShopifyServiceProvider"
This is the content of the published config file:
// config/shopify.php return [ 'api_key' => env('SHOPIFY_KEY'), 'api_secret' => env('SHOPIFY_SECRET'), 'shop_domain' => env('SHOPIFY_DOMAIN'), 'access_token' => env('SHOPIFY_TOKEN'), ];
Usage
Once installed, you can use the service by either injecting it to your methods or as a real time facade, and then just use it regularly.
For more information about how to use the service, look at https://github.com/joshrps/laravel-shopify-API-wrapper.
Dependency Injection
Now you can simply type hint the service in your method's arguments. For better readabilty, we prefer to import the full class name with a use statement, and alias it to Shopify while we're at it.
use RocketCode\Shopify\API as Shopify; Route::get('/', function (Shopify $shopify) { $call = $shopify->call( [ 'URL' => 'products.json', 'METHOD' => 'GET', 'DATA' => [ 'limit' => 5, 'published_status' => 'any' ] ]); });
Facade
Now you can use Laravel's on the fly facades feature to use the service "statically". We prefer to alias it to ShopifyAPI while we're at it.
use Facades\RocketCode\Shopify\API as ShopifyAPI; Route::get('/', function () { $call = ShopifyAPI::call( [ 'URL' => 'products.json', 'METHOD' => 'GET', 'DATA' => [ 'limit' => 5, 'published_status' => 'any' ] ]); });
Credits
License
The MIT License (MIT). Please see License File for more information.
boaideas/laravel-shopify 适用场景与选型建议
boaideas/laravel-shopify 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.33k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2017 年 09 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「shopify」 「laravel」 「BOA Ideas」 「laravel-shopify」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 boaideas/laravel-shopify 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 boaideas/laravel-shopify 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 boaideas/laravel-shopify 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A PSR-7 compatible library for making CRUD API endpoints
Shopify package for Laravel to aide in app development
A basic Shopify API wrapper with REST and GraphQL support.
A set of APIs to retrieve data from Shopify
Alfabank REST API integration
PHP SDK for Shopify API
统计信息
- 总下载量: 2.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-25