定制 kfoobar/laravel-sportmonks-soccer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kfoobar/laravel-sportmonks-soccer

最新稳定版本:v1.0.0

Composer 安装命令:

composer require kfoobar/laravel-sportmonks-soccer

包简介

Laravel package for Sportmonks Soccer API v2.0. Fork of kirill-latish/laravel-sportmonks-soccer

README 文档

README

This package is a wrapper for Sportmonks Soccer API for Laravel 7/8/9.

This is a fork of kirill-latish/laravel-sportmonks-soccer with added support for Larvel 7+.

Installation

Install the package via Composer:

composer require kfoobar/laravel-sportmonks-soccer

Add your API token to your .env file:

SPORTMONKS_API_TOKEN=

For more settings, you can publish the config file:

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

Usage

Example when using the facade:

use SoccerAPI;

...

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

Relations

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

$response = SoccerAPI::seasons()->setInclude(['league', 'fixtures'])->all();

Response

The default behaviour is to return an object containing a data array:

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

var_dump($response->data);
{
    "data": [
        {
            "id": null,
            "league_id": null,
            "scores": {
                "localteam_score": 0,
                "visitorteam_score": 0
            }
        }
    ]
}

If you want to directly retrieve the properties inside data, set skip_data to true in your config file.

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

var_dump($response);
{
    "id": null,
    "league_id": null,
    "scores": {
        "localteam_score": 0,
        "visitorteam_score": 0
    }
}

Documentation

Please refer to the official documentation as to which API calls can be made.

Contributing

Thank you for considering contributing!

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 40
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固