Breaking

Code Gripper
Responsive Advertisement
  • Home
HomeLaravel

What is throttling and how to implement it in Laravel?

byMahabubur Rahman -October 16, 2022
0

 Throttling is a process to rate-limit requests from a particular IP. This can be used to prevent DDOS attacks as well. For throttling, Laravel provides a middleware that can be applied to routes and it can be added to the global middlewares list as well to execute that middleware for each request.

Here’s how you can we add it to a particular route:

Route::middleware('auth:api', 'throttle:30,1')->group(function () {
    Route::get('/user', function () {
        //
    });
});

This will enable the /user route to be accessed by a particular user from a particular IP only 30 times in a minute.

Tags Laravel php
  • Facebook
  • Twitter

You may like these posts

Post a Comment

Previous Post Next Post

Follow Us

Popular Posts

Subscribe Us

Facebook

Categories

Main Tags

Code Gripper

September 30, 2023

Total Pageviews

Search This Blog

CODE GRIPPER

Code Gripper
CODE GRIPPER

  • Home
  • Python
  • PHP

Menu Footer Widget

  • Home
  • About
  • Contact Us
Code Gripper

About Us

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's.

Categories

Main Tags

Latest Posts

Most Popular

Design by Blogger | Distributed by Gooyaabi
  • Home
  • About Us
  • Contact Us
  • RTL Version

Contact Form