From 11ea1cbf2f6f70fad4e43a8e2a7c35a18a1c24ae Mon Sep 17 00:00:00 2001 From: A1Gard Date: Wed, 25 Sep 2024 01:36:24 +0330 Subject: [PATCH] added attempts to rate --- app/Http/Controllers/ClientController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 373ac6a..8a5086a 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -235,6 +235,7 @@ public function search(Request $request) { + if (isGuestMaxAttemptTry('search', 5, 1)) { return abort(403); } @@ -736,7 +737,18 @@ public function rate(Request $request) 'rateable_type' => ['required', 'string'], ]); -// return $request->all(); + + // return $request->all(); + + if (isGuestMaxAttemptTry('rate', 5, 10)) { + return [ + 'OK' => false, + 'message' => __('You try attempts, Try it a few minutes'), + 'error' => __('You try attempts, Try it a few minutes'), + ]; + } + + guestLog('rate'); $changed = false; foreach ($request->rate as $k => $rt) {