kirill-latish/laravel-sportmonks-soccer 问题修复 & 功能扩展

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

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

kirill-latish/laravel-sportmonks-soccer

最新稳定版本:v2.0.3

Composer 安装命令:

composer create-project kirill-latish/laravel-sportmonks-soccer

包简介

Laravel wrapper for Soccerama score API calls v2.0. Fork of rebing/laravel-soccerama

README 文档

README

Laravel wrapper for Sportmonks (live) score API calls. Documentation for the API can be found here

Installation

1- Require the package via Composer in your composer.json.

{
  "require": {
    "kirill-latish/laravel-sportmonks-soccer": "^2.0"
  }
}

2- Run Composer to install or update the new requirement.

$ composer install

or

$ composer update

3- Add the service provider to your app/config/app.php file

Sportmonks\SoccerAPI\SoccerAPIServiceProvider::class,

4- Add the facade to your app/config/app.php file

'SoccerAPI' => Sportmonks\SoccerAPI\Facades\SoccerAPI::class,

5- Publish the configuration file

$ php artisan vendor:publish --provider="Sportmonks\SoccerAPI\SoccerAPIServiceProvider"

6- Review the configuration file and add your token (preferably through env: 'api_token' => env('API_TOKEN') )

config/soccerapi.php

7- Review the configuration file and add your timezone (preferably through config file: 'timezone' => config('app.timezone') )

config/soccerapi.php

Usage

Refer to the official docs as to which calls can be made and check the calls in traits under Sportmonks\SoccerAPI\Requests.

For example, get all leagues (if using facade):

use SoccerAPI;

...

$response = SoccerAPI::leagues()->all();

The above returns an object containing a data array. If you want to directly retrieve the data within data, change your config file: 'without_data' => true

Get a match by its id:

$response = SoccerAPI::fixtures()->byId($id);

If you need to include other relations (check the official docs for which relations can be included):

$include = 'league,fixtures';
// Or: $include = ['league', 'fixtures'];

$response = SoccerAPI::seasons()->setInclude($include)->all();

统计信息

  • 总下载量: 14.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 16
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 16
  • Watchers: 2
  • Forks: 38
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-06-06