hex-digital / candy-api
由Laravel编写的API驱动的电子商务解决方案
v0.1.9
2019-03-20 11:15 UTC
Requires
- php: >=7.1.3
- alaouy/youtube: ^2.1
- barryvdh/laravel-cors: ^0.11.0
- barryvdh/laravel-dompdf: ^0.8.2
- braintree/braintree_php: ^3.28
- doctrine/dbal: 2.7
- hashids/hashids: ^2.0
- intervention/image: ^2.4
- kalnoy/nestedset: ^4.3
- laravel/framework: ^5.6
- laravel/passport: ^7.0
- laravel/tinker: ^1.0
- league/fractal: ^0.17.0
- paypal/rest-api-sdk-php: *
- ruflin/elastica: ^6.0
- spatie/laravel-permission: ^2.9
- vimeo/laravel: ^5.0
- vinkla/hashids: ^4.0
Requires (Dev)
- filp/whoops: ~2.0
- fzaninotto/faker: ~1.4
- mockery/mockery: ~1.0
- orchestra/testbench: ~3.6
- phpunit/phpunit: ~7.0
Replaces
- getcandy/candy-api: 0.1.16
This package is auto-updated.
Last update: 2019-05-25 15:33:54 UTC
README
请注意
尽管已经尽最大努力使此软件准备发布,但它是“原样提供”的,目前仍处于早期alpha阶段,您使用它存在风险。
这不是生产就绪软件
GetCandy电子商务API
通过Laravel构建API驱动在线商店的方式。
要求
- Laravel >= 5.5
- Elasticsearch >= 6
服务器设置
我们认为最容易的方式是使用Valet+和Elasticsearch。但事实上,这完全取决于您:)
通过Composer安装
您可以只安装API,也可以安装API和Hub。
仅安装API
这将包含您通过API端点管理商店所需的一切。
composer require getcandy/candy-api
API和Hub(推荐)
这将安装API和Hub,因此您有一个漂亮的界面来管理您的商店。
composer require getcandy/candy-hub
Laravel 5.6
GetCandy支持包自动发现
Laravel 5.5
将三个必需的服务提供者添加到您的config/app.php
文件中
'providers' => [ // ... GetCandy\Api\Providers\ApiServiceProvider::class, GetCandy\Api\Providers\EventServiceProvider::class, // If you have installed the hub, add this one GetCandy\Hub\Providers\HubServiceProvider::class ],
发布配置/资源
API需要发布一些配置项,Hub(如果您使用它)需要发布一些资源
php artisan vendor:publish --tag=config
// If using the hub
php artisan vendor:publish --tag=public
设置您的用户
GetCandy没有它自己的用户模型,我们认为您会想要自己的,所以我们只是使用了一个特质
use GetCandy\Api\Core\Traits\HasCandy; class User extends Authenticatable { use HasCandy;
API使用passport进行认证,所以请确保您的config/auth.php
配置使用此配置
这可能会在未来重构为其自己的门,非包时代的遗留问题...
'guards' => [ // ... 'api' => [ 'driver' => 'passport', 'provider' => 'users', ] ]
让一切启动起来
API需要一些最基本的数据才能启动,目前我们只是创建了一个控制台命令来启动
php artisan candy:install
按照安装步骤,您将能够登录并开始添加产品!