Today's question comes courtesy of Sam, who would like to know how to limit the number of downloads each user in their application can initiate. This question focuses on downloads, however, the technique we use for the solution can of course be applied to any request that you wish to rate limit. While we can solve this manually with basic caching, let's instead leverage Laravel's built in throttling route middleware.
Published on Nov 18th, 2019.
Understand.io is used by hundreds of Laravel developers to find and fix errors.
Sign up for a free 14-day trial now.