8000 updates rate-limiting.m (#8804) · Sn0wCrack/laravel-docs@cbaac70 · GitHub
[go: up one dir, main page]

Skip to content

Commit cbaac70

Browse files
authored
updates rate-limiting.m (laravel#8804)
1 parent f9089ad commit cbaac70

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rate-limiting.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ If you would like to manually interact with the rate limiter, a variety of other
6666
return 'Too many attempts!';
6767
}
6868

69+
RateLimiter::hit('send-message:'.$user->id);
70+
71+
// Send message...
72+
6973
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:
7074

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

96+
RateLimiter::hit('send-message:'.$user->id);
97+
98+
// Send message...
99+
92100
<a name="clearing-attempts"></a>
93101
### Clearing Attempts
94102

0 commit comments

Comments
 (0)
0