From b10b52e7ab96ec280192c937528a5017c6ab9ac5 Mon Sep 17 00:00:00 2001 From: dyzulk <66510723+dyzulk@users.noreply.github.com> Date: Tue, 6 Jan 2026 09:39:49 +0700 Subject: [PATCH] feat: organize ticket attachments by user id --- app/Http/Controllers/Api/TicketController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/TicketController.php b/app/Http/Controllers/Api/TicketController.php index 6d12042..f16767c 100644 --- a/app/Http/Controllers/Api/TicketController.php +++ b/app/Http/Controllers/Api/TicketController.php @@ -82,7 +82,7 @@ class TicketController extends Controller // Handle Attachments if ($request->hasFile('attachments')) { foreach ($request->file('attachments') as $file) { - $path = $file->store('ticket-attachments', 'r2-private'); + $path = $file->store("ticket-attachments/{$user->id}", 'r2-private'); // $url = Storage::disk('r2')->url($path); // Removed public URL generation TicketAttachment::create([ 'ticket_reply_id' => $reply->id, @@ -170,7 +170,7 @@ class TicketController extends Controller // Handle Attachments if ($request->hasFile('attachments')) { foreach ($request->file('attachments') as $file) { - $path = $file->store('ticket-attachments', 'r2-private'); + $path = $file->store("ticket-attachments/{$user->id}", 'r2-private'); // $url = Storage::disk('r2')->url($path); TicketAttachment::create([ 'ticket_reply_id' => $reply->id,