njaaazi/laravel-fpl

Fantasy Premier League API wrapper for Laravel.

dev-main 2023-08-28 15:21 UTC

README

Tests codecov Latest Version on Packagist Total Downloads

Fantasy Premier League API wrapper for Laravel.

Installation

You can install the package via composer:

composer require njaaazi/laravel-fpl

You can publish the config file with:

php artisan vendor:publish --tag="laravel-fpl-config"

This is the contents of the published config file:

return [
    "base-url" => env(
        "FPL_BASE_URL",
        "https://fantasy.premierleague.com/api",
    ),
];

Usage

use Njaaazi\Fpl\FplClient;

$fpl = new FplClient;

$generalInfo = $fpl->generalInfo();
$allFixtures = $fpl->allFixtures();

Using Facade

use Njaaazi\Fpl\Facades\Fpl;

$generalInfo = Fpl::generalInfo();
$allFixtures = Fpl::allFixtures();

Testing

vendor/bin/phpunit

or

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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