Posts List

How to customize Laravel request throttle message in API response?

When you are using laravel api, then you must use throttling to protect your api from scrapping or any other attack. When you are limiting your api using laravel throttle then you get a html response message containing “Too Many Attempts.” In order to change the message in a custom format and json reponse follow the steps below: Create a new file ThrottleRequestsMiddleware.php in __ app/Http/Middleware/__ and paste the code below: