gonzaloner / laravel-trustspot
为 Laravel 提供的一个非常基础的 TrustSpot API 客户端封装
0.2.1
2017-10-01 00:49 UTC
Requires
- gonzaloner/trustspot-api-php: 0.2.*
Requires (Dev)
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2024-09-20 07:32:41 UTC
README
TrustSpot API 客户端封装 for Laravel
Laravel-TrustSpot 将 TrustSpot API 集成到您的 Laravel 或 Lumen 项目中。
安装
使用 composer require
命令将 Laravel-TrustSpot 添加到您的 composer 文件中
$ composer require gonzaloner/laravel-trustspot
Laravel 5.5+ 将使用自动发现功能。
在 Laravel 5.4(或您不使用自动发现)中,通过将服务提供者添加到 config/app.php
中的 providers
键来注册服务提供者。同时,通过将别名添加到 config/app.php
中的 aliases
键来注册外观。
'providers' => [ ... Gonzaloner\LaravelTrustSpot\LaravelTrustSpotServiceProvider::class, ], 'aliases' => [ ... 'LaravelTrustSpot' => Gonzaloner\LaravelTrustSpot\Facades\LaravelTrustSpot::class, ]
为了添加您的 API 密钥,您必须执行
$ php artisan vendor:publish --provider="Gonzaloner\LaravelTrustSpot\LaravelTrustSpotServiceProvider"
之后,将创建 config/laraveltrustspot.php
文件。在此文件中,您将找到可以在此软件包中编辑的所有字段。
用法
目前,仅支持公司评论获取 API。
获取公司评论
应该在类似以下视图中进行调用
{{ LaravelTrustSpot::company->get(optional int $limit, optional int $offset, optional string $sort) }}
许可
MIT 许可证 版权 (c) 2017