足球 / 足球数据
足球数据.org API 容器,适用于 Laravel 5.5 或更高版本
v1.0.1
2021-07-22 16:26 UTC
This package is auto-updated.
Last update: 2024-09-22 23:15:24 UTC
README
football-data.org API 容器,适用于 Laravel 5.5 或更高版本
要求
- "guzzlehttp/guzzle": "~6.0"
安装
通过 Composer
$ composer require football/football-data
使用方法
有关过滤器、结构和 API 的更多信息,请参阅:足球数据文档
将 API 密钥添加到 env 文件中
FOOTBALLDATA_API_KEY={YOUR_API_KEY}
添加到 config/app.php
'providers' => [
Football\FootballData\FootballDataServiceProvider::class,
]
'aliases' => [
'Football' => Football\FootballData\Facades\FootballDataFacade::class,
]
示例
所有可用的比赛。可以在该方法中添加可选的区域过滤器。
Football::allCompetitions();
Football::allCompetitions(string $area);
特定比赛的比赛。可用所有过滤器都在数组变量中。
Football::allMatches(int $id);
Football::allMatches(int $id, array $filters);
特定球队的比赛。可用所有过滤器都在数组变量中。
Football::allMatchesForTeam(int $id);
Football::allMatchesForTeam(int $id, array $filters);
特定比赛的球队。可以在该方法中添加可选的阶段过滤器。
Football::allTeams(int $id);
Football::allTeams(int $id, string $stage);
特定比赛。
Football::findCompetition($id);
给定特定比赛的成绩。
Football::findStandings($id);
具有指定过滤器的比赛。
Football::findFilteredMatch(array $filters);
特定比赛。
Football::findMatch(int $id);
一支球队。
Football::findTeam(int $id);
球队的阵容。 (此方法返回数组而不是对象)。
Football::findTeamSquad(int $id)
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅许可证文件。