jonathanstaniforth/laravel-with-limits

This package is abandoned and no longer maintained. No replacement package was suggested.

Laravel with limits is a Laravel package that handles API rate limits, down to the method level. The package will read rate limit headers and keep track of requests to prevent exceeding rate limits. GuzzleHttp is used to send requests and receive responses.

v1.0.6 2020-04-27 02:45 UTC

This package is auto-updated.

Last update: 2022-06-02 08:58:52 UTC


README

Latest Version on Packagist Software License Total Downloads

Laravel with limits is a Laravel package that handles API rate limits, down to the method level. The package will read rate limit headers and keep track of requests to prevent exceeding rate limits. GuzzleHttp is used to send requests and receive responses.

Install

Via Composer

$ composer require jonathanstaniforth/laravel-with-limits

Usage

$request = new LaravelWithLimits\Request();

$response = $request->method('GET')
    ->path('static-data/v3/champions')
    ->withParameters(['locale' => 'en_GB', 'tags' => 'all'])
    ->withLimit(function ($rate_limit) {
        $rate_limit->api('riot')
            ->endpoint('static-data/v3/champions')
            ->header('X-Method-Rate-Limit');
    })->send();

Security

If you discover any security related issues, please email jonathanstaniforth@gmail.com instead of using the issue tracker.

Credits

License

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