8000 Clarification about rate limiter by stebogit · Pull Request #8804 · laravel/docs · GitHub
[go: up one dir, main page]

Skip to content

Clarification about rate limiter #8804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally 8000 send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
updates rate-limiting.m
  • Loading branch information
stebogit committed May 22, 2023
commit 1b3336ab97e457ba3b2b909bc7728ab8893d5fc1
8 changes: 8 additions & 0 deletions rate-limiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ If you would like to manually interact with the rate limiter, a variety of other
return 'Too many attempts!';
}

RateLimiter::hit('send-message:'.$user->id);

// Send message...

Alternatively, you may use the `remaining` method to retrieve the number of attempts remaining for a given key. If a given key has retries remaining, you may invoke the `hit` method to increment the number of total attempts:

use Illuminate\Support\Facades\RateLimiter;
Expand All @@ -89,6 +93,10 @@ When a key has no more attempts left, the `availableIn` method returns the numbe
return 'You may try again in '.$seconds.' seconds.';
}

RateLimiter::hit('send-message:'.$user->id);

// Send message...

<a name="clearing-attempts"></a>
### Clearing Attempts

Expand Down
0