diff --git a/app/Http/Controllers/TicketsController.php b/app/Http/Controllers/TicketsController.php
index 8155037b..8f4391ce 100644
--- a/app/Http/Controllers/TicketsController.php
+++ b/app/Http/Controllers/TicketsController.php
@@ -91,7 +91,7 @@ class TicketsController extends Controller
return $tickets->ticketcategory->name;
})
->editColumn('title', function (Ticket $tickets) {
- return '' . "#" . $tickets->ticket_id . " - " . $tickets->title . '';
+ return '' . "#" . $tickets->ticket_id . " - " . $tickets->title . '';
})
->editColumn('status', function (Ticket $tickets) {
switch ($tickets->status) {
diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php
index 3bd3c81e..6dbbc407 100644
--- a/app/Providers/RouteServiceProvider.php
+++ b/app/Providers/RouteServiceProvider.php
@@ -59,5 +59,11 @@ class RouteServiceProvider extends ServiceProvider
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
+ RateLimiter::for('ticket-new', function (Request $request) {
+ return Limit::perMinute(3)->by(optional($request->user())->id ?: $request->ip());
+ });
+ RateLimiter::for('ticket-reply', function (Request $request) {
+ return Limit::perMinute(4)->by(optional($request->user())->id ?: $request->ip());
+ });
}
}
diff --git a/routes/web.php b/routes/web.php
index 01fce126..2dbbb757 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -98,9 +98,9 @@ Route::middleware(['auth', 'checkSuspended'])->group(function () {
Route::get('ticket', [TicketsController::class, 'index'])->name('ticket.index');
Route::get('ticket/datatable', [TicketsController::class, 'datatable'])->name('ticket.datatable');
Route::get('ticket/new', [TicketsController::class, 'create'])->name('ticket.new');
- Route::post('ticket/new', [TicketsController::class, 'store'])->name('ticket.new.store');
+ Route::post('ticket/new', [TicketsController::class, 'store'])->middleware(['throttle:ticket-new'])->name('ticket.new.store');
Route::get('ticket/show/{ticket_id}', [TicketsController::class, 'show'])->name('ticket.show');
- Route::post('ticket/reply', [TicketsController::class, 'reply'])->name('ticket.reply');
+ Route::post('ticket/reply', [TicketsController::class, 'reply'])->middleware(['throttle:ticket-reply'])->name('ticket.reply');
}
#admin