“Throttle Laravel” Kode Jawaban

Laravel Throttle

//Controller add

public function __construct()
	{
		$this->middleware([
			'auth',
//About 20 requests per minute to Cotroller and error if there are too many requests
			'throttle:20,1'
        ]);
	}
Shadow

Throttle Laravel

//In Laravel we use throttle middleware to restrict the amount of traffic 
//for a given route or group of routes. The throttle middleware accepts two parameters 
//that determine the maximum number of requests that can be made in a given number of minutes. 
//For example: 
//Here 60 is number of requests you can make in 1 minute.
  
Route::middleware('throttle:60,1')->get('/user', function () { 
  //
});
Code Junk

Jawaban yang mirip dengan “Throttle Laravel”

Pertanyaan yang mirip dengan “Throttle Laravel”

Lebih banyak jawaban terkait untuk “Throttle Laravel” di PHP

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya