feat(basket): add throttling middleware for basket actions
This change introduces a throttling middleware to limit the rate of requests for adding, removing, and emptying the basket, enhancing the application's performance and security.
This commit is contained in:
parent
4dd7cc82fe
commit
43d63bce2e
1 changed files with 6 additions and 3 deletions
|
|
@ -13,11 +13,14 @@ Route::get('products/filter', ProductsController::class)->name('products.filter'
|
|||
// * BASKET
|
||||
Route::name('basket.')->prefix('basket')->group(function (): void {
|
||||
Route::get('get', [BasketController::class, 'get'])->name('get');
|
||||
Route::post('add', [BasketController::class, 'add'])->name('add');
|
||||
Route::post('remove', [BasketController::class, 'remove'])->name('remove');
|
||||
Route::post('empty', [BasketController::class, 'empty'])->name('empty');
|
||||
Route::middleware('throttle:30,1')->group(function (): void {
|
||||
Route::post('add', [BasketController::class, 'add'])->name('add');
|
||||
Route::post('remove', [BasketController::class, 'remove'])->name('remove');
|
||||
Route::post('empty', [BasketController::class, 'empty'])->name('empty');
|
||||
});
|
||||
});
|
||||
|
||||
// * ORDERS TUNNEL
|
||||
Route::get('/shops/{shop}/pickup-timeslots', [PickupController::class, 'getAvailableTimeslots'])
|
||||
->middleware(['auth:frontend', 'verified', 'is-employed'])
|
||||
->name('shops.pickup-timeslots');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue