Football-Data.org Api container for Laravel 5
Clone or download
grambas Merge pull request #7 from micossander/master
Upgrade API version for v2
Latest commit 1e3cc31 Aug 14, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Update for football-data API v2 Jun 29, 2018
.editorconfig development Jun 2, 2016
.gitattributes :octocat: Added .gitattributes & .gitignore files Jun 2, 2016
.gitignore :octocat: Added .gitattributes & .gitignore files Jun 2, 2016
.styleci.yml development Jun 2, 2016
CHANGELOG.md development Jun 2, 2016
CONDUCT.md development Jun 2, 2016
CONTRIBUTING.md development Jun 2, 2016
LICENSE.md development Jun 2, 2016
README.md Update README.md Jun 29, 2018
composer.json comma error Aug 29, 2016

README.md

:FootballData

football-data.org API Container for Laravel 5.1, 5.2

Requirements

  • "guzzlehttp/guzzle": "~6.0"

Install

Via Composer

$ composer require grambas/football-data dev-master

Usage

More about filters, structure and API: football-data.org Documentation

Add your api key to env. file

FootballData_API_KEY=

add to config/app.php

'providers' => [
  Grambas\FootballData\FootballDataServiceProvider::class,
]

'aliases' => [
  'Football' => Grambas\FootballData\Facades\FootballDataFacade::class,
]

Examples

##COMPETITION/LEAGUE
	
/**
 * List all available competitions.
 *
 * @param array $filter ['areas' => 'Integer /[0-9]+/']
 * @return Collection
 */
Football::getLeagues(array $filter = ['areas' => ''])

/**
 * List one particular competition.
 *
 * @param integer $leagueID 
 * @param array $filter ['areas' => 'Integer /[0-9]+/']
 * @return Collection
 */ 
Football::getLeague(int $leagueID, array $filter = ['areas' => ''])

/**
 * List all teams for a particular competition.
 *
 * @param integer $leagueID
 * @param array $filter ['stage' => 'String /[A-Z]+/']
 * @return Collection
 */
Football::getLeagueTeams(int $leagueID, array $filter = ['stage' => ''])

/**
 * 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
 * @param array $filter ['dateFrom' => 'yyyy-MM-dd', 'dateTo' => 'yyyy-MM-dd', 'stage' => 'String /[A-Z]+/', 'status' => 'SCHEDULED | LIVE | IN_PLAY | PAUSED | FINISHED | POSTPONED | SUSPENDED | CANCELED', 'matchday' => 'Integer /[1-4]*[0-9]', 'group' => '']
 * @return Collection
 */
Football::getLeagueMatches(int $leagueID, array $filter = [ 'dateFrom' => '', 'dateTo' => '', 'stage' => '', 'status' => '', 'matchday' => '', 'group' => '' ])
	


##FIXTURES/MATCHES

/**
 * List matches across (a set of) competitions.	
 *
 * @param array $filter [ 'competitions' => 'Integer /[0-9]+/', 'dateFrom' => 'yyyy-MM-dd', 'dateTo' => 'yyyy-MM-dd', 'status' => 'SCHEDULED | LIVE | IN_PLAY | PAUSED | FINISHED | POSTPONED | SUSPENDED | CANCELED' ]
 * @return Collection
 */
Football::getMatches(array $filter = [ 'competitions' => '', 'dateFrom' => '', 'dateTo' => '', 'status' => '' ])

/**
 * Show one particular match.	
 *
 * @param integer $matchID
 * @return Collection
 */
Football::getMatche(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
 * @param array $filter ['dateFrom' => 'yyyy-MM-dd', 'dateTo' => 'yyyy-MM-dd', 'status' => 'SCHEDULED | LIVE | IN_PLAY | PAUSED | FINISHED | POSTPONED | SUSPENDED | CANCELED', 'venue' => 'home|away']
 * @return Collection
 */
Football::getMatchesForTeam(int $teamID, array $filter = [ 'dateFrom' => '', 'dateTo' => '', 'status' => '', 'venue' => '' ])



##AREAS
	
/**
 * List all available areas.
 *
 * @return Collection
 */
Football::getAreas()

/**
 * List one particular area.
 *
 * @param integer $areaID 
 * @return Collection
 */
Football::getArea(int $areaID)

License

The MIT License (MIT). Please see License File for more information.