PHP code example of beyondcode / laravel-sliding-window-limiter

1. Go to this page and download the library: Download beyondcode/laravel-sliding-window-limiter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

beyondcode / laravel-sliding-window-limiter example snippets


$limiter->attempt('user_1');

$count = $limiter->getUsage('user_1');

$limiter->reset('user_1');
 php
$limiter = SlidingWindowLimiter::create(CarbonInterval::minute(1), 100, CarbonInterval::second());