Looking to hire Laravel developers? Try LaraJobs

laravel-with-limits maintained by jonathanstaniforth

Description
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.
Last update
2020/04/27 04:45 (dev-master)
License
Downloads
9

Comments
comments powered by Disqus

Laravel with limits

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.