From 51e074e91c056511fca4807bfcc54d18210ac73b Mon Sep 17 00:00:00 2001 From: Mark Gregory Date: Mon, 22 Jun 2026 14:26:28 +0100 Subject: [PATCH] working timers --- Modules/Helpdesk/Livewire/TicketTimer.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Modules/Helpdesk/Livewire/TicketTimer.php b/Modules/Helpdesk/Livewire/TicketTimer.php index f9f7a8d2..db87ea80 100644 --- a/Modules/Helpdesk/Livewire/TicketTimer.php +++ b/Modules/Helpdesk/Livewire/TicketTimer.php @@ -36,7 +36,7 @@ class TicketTimer extends Component /** * Start a database-backed timer for the current authenticated user. * - * @throws \Illuminate\Validation\ValidationException + * @throws ValidationException */ public function startTimer(): void { @@ -78,7 +78,7 @@ class TicketTimer extends Component /** * End the current user's active timer and persist seconds/minutes. * - * @throws \Illuminate\Validation\ValidationException + * @throws ValidationException */ public function endTimer(): void { @@ -92,9 +92,10 @@ class TicketTimer extends Component } $endedAt = Carbon::now(); - $seconds = max(1, (int) $timer->started_at->diffInSeconds($endedAt)); - $minutes = (int) ceil($seconds / 60); $description = trim($this->description) !== '' ? trim($this->description) : $timer->description; + $seconds = max(1, (int) $timer->started_at->diffInSeconds($endedAt)); + + $minutes = (int) ceil($seconds / 60); $timer->forceFill([ 'ended_at' => $endedAt, @@ -163,7 +164,7 @@ class TicketTimer extends Component /** * Return the authenticated user or fail validation cleanly. * - * @throws \Illuminate\Validation\ValidationException + * @throws ValidationException */ private function authenticatedUser(): Authenticatable {