master

laravel/framework

Last updated at: 29/12/2023 09:21

GlobalLimit.php

TLDR

The file GlobalLimit.php contains the GlobalLimit class, which extends the Limit class. It creates a new limit instance for rate limiting.

Classes

GlobalLimit

The GlobalLimit class extends the Limit class. It is used to create a new rate limit instance. The GlobalLimit constructor takes two parameters: $maxAttempts and $decaySeconds. The $maxAttempts parameter specifies the maximum number of attempts allowed within the specified time window, and the $decaySeconds parameter specifies the time window in seconds. By default, the $decaySeconds parameter is set to 60 seconds.

Methods None

<?php

namespace Illuminate\Cache\RateLimiting;

class GlobalLimit extends Limit
{
    /**
     * Create a new limit instance.
     *
     * @param  int  $maxAttempts
     * @param  int  $decaySeconds
     * @return void
     */
    public function __construct(int $maxAttempts, int $decaySeconds = 60)
    {
        parent::__construct('', $maxAttempts, $decaySeconds);
    }
}