jamesm/api-football

api-football.com API 容器,用于 Laravel(高度灵感来源于 grambas/football-data)

dev-master 2022-03-09 20:44 UTC

This package is auto-updated.

Last update: 2024-09-05 01:03:42 UTC


README

api-football.com API 容器,用于 Laravel(高度灵感来源于 grambas/football-data)

需求

  • "guzzlehttp/guzzle": "~7.4.1"

安装

通过 Composer

$ composer require jamesm/api-football

使用

有关过滤器、结构和 API 的更多信息: api-football.com 文档

将您的 API 密钥添加到 env 文件中

APIFOOTBALL_API_KEY=

添加到 config/app.php

'providers' => [
  jamesm\APIfootball\APIFootballServiceProvider::class,
]

'aliases' => [
  'Football' =>jamesm\APIfootball\Facades\APIFootballFacade::class,
]

示例

##COMPETITION/LEAGUE

/**
 * List one particular competition.
 *
 * @param integer $leagueID 
 * @return Collection
 */ 
Football::getLeague(int $leagueID)

/**
 * Show Standings for a particular competition

 * @param integer $leagueID
 * @return Collection
 */
Football::getLeagueStandings(int $leagueID)

/**
 * List all matches for a particular competition.
 *
 * @param integer $leagueID
 * @return Collection
 */
Football::getLeagueMatches(int $leagueID)
	


##FIXTURES/MATCHES

/**
 * List matches across (a set of) competitions.	
 *
 * @return Collection
 */
Football::getMatches()

/**
 * Show one particular match.	
 *
 * @param integer $matchID
 * @return Collection
 */
Football::getMatch(int $matchID)



##TEAM

/**
 * Show one particular team.	
 *
 * @param integer $teamID
 * @return Collection
 */
Football::getTeam(int $teamID)

/**
 * Show all matches for a particular team.
 *
 * @param integer $teamID
 * @return Collection
 */
Football::getMatchesForTeam(int $teamID)

/**
 * List all matches for a particular competition wthdate
 *
 * @param integer $leagueID
 * @param date $date
 * @return Collection
 */
Football::getLeagueMatchesWithDate(int $leagueID,$date)

许可证

MIT 许可证(MIT)。有关更多信息,请参阅许可证文件