antwerpfactory / laravel-lightspeed-restaurant
用于Lightspeed餐厅API的Laravel 5包
v1.0.0
2017-12-01 12:46 UTC
Requires
- php: >=5.6.4
- guzzlehttp/guzzle: ~6.0
- laravel/framework: ~5.4
Requires (Dev)
- phpunit/phpunit: ~5.7
- squizlabs/php_codesniffer: ^3.0.2
This package is not auto-updated.
Last update: 2024-09-27 15:18:12 UTC
README
Laravel Lightspeed Restaurant
此包使与Lightspeed餐厅API交互变得简单。安装后,您可以像这样执行所有API调用
use Lightspeedresto; app()->lightspeedresto->core()->getCompanies(); // container Lightspeedresto::core()->getCompanies(); // or use the facade Lightspeedresto::core()->getCompany($companyId); Lightspeedresto::onlineOrdering()->getCustomers(); Lightspeedresto::onlineOrdering()->updateOrderPartial($companyId, $orderId, $data); Lightspeedresto::inventory()->addProduct($productGroupId, $data);
我们建议使用 fractals 来转换传递给API的数据。
安装
通过composer安装包
composer require antwerpfactory/laravel-lightspeed-restaurant
除非您正在使用Laravel 5.5,否则您需要注册ServiceProvider和Facade
'providers' => [ ... AntwerpFactory\LightspeedRestaurant\ServiceProvider::class, ];
'aliases' => [ ... 'Lightspeedresto' => AntwerpFactory\LightspeedRestaurant\Facade::class, ... ]
配置
使用此命令发布配置
php artisan vendor:publish --provider="AntwerpFactory\LightspeedRestaurant\ServiceProvider"
这将发布名为 lightspeedrestaurant.php 的文件到您的config目录,内容如下
<?php return [ /* |-------------------------------------------------------------------------- | User Creditentials |-------------------------------------------------------------------------- */ 'username' => env('LIGHTSPEED_RESTAURANT_USER_NAME'), 'password' => env('LIGHTSPEED_RESTAURANT_PASSWORD'), 'companyId' => env('LIGHTSPEED_RESTAURANT_COMPANYID'), 'server' => env('LIGHTSPEED_RESTAURANT_SERVER'), 'deviceId' => 'api', ];
测试
$ make sniff test
贡献
有关详细信息,请参阅 贡献指南
许可证
MIT许可证(MIT)。请参阅 许可证文件 获取更多信息。