For example, there is a route:

Route::group(['prefix' => 'api', 'middleware' => 'throttle'], function () { Route::get('people', function () { return Person::all(); });}); 

How to catch the throttle error in the Handler class?

 public function render($request, Exception $e) { if ($e instanceof TooManyRequestsHttpException) { //получить здесь } return parent::render($request, $e); } 

    0