From d5ef117afaece8b164a123519b48387f2e3982eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Mon, 16 Mar 2026 16:00:40 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[daily-work-log]=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20=EC=A0=95=EC=B1=85=20=EC=A4=80=EC=88=98=20?= =?UTF-8?q?(docs=20=EA=B8=B0=EC=A4=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 경로: {tenant_id}/daily-work-log/{year}/{month}/{hex}.ext 형식으로 변경 - 파일명: UUID → 64bit 난수 hex (bin2hex(random_bytes(8))) - 최대 크기: 10MB → 20MB (file-storage-guide.md 기준) --- .../Controllers/Finance/DailyWorkLogController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Finance/DailyWorkLogController.php b/app/Http/Controllers/Finance/DailyWorkLogController.php index ab51da84..3da3e13e 100644 --- a/app/Http/Controllers/Finance/DailyWorkLogController.php +++ b/app/Http/Controllers/Finance/DailyWorkLogController.php @@ -9,7 +9,6 @@ use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Str; class DailyWorkLogController extends Controller { @@ -201,7 +200,7 @@ public function uploadFile(Request $request): JsonResponse $request->validate([ 'log_date' => 'required|date', 'field_key' => 'required|in:memo,reflection', - 'file' => 'required|file|max:10240', + 'file' => 'required|file|max:20480', ]); $tenantId = session('selected_tenant_id', 1); @@ -212,9 +211,10 @@ public function uploadFile(Request $request): JsonResponse ); $file = $request->file('file'); - $storedName = Str::uuid().'.'.$file->getClientOriginalExtension(); - $basePath = "daily-work-log/{$tenantId}/{$log->id}"; - $filePath = "{$basePath}/{$storedName}"; + $storedName = bin2hex(random_bytes(8)).'.'.$file->getClientOriginalExtension(); + $year = date('Y'); + $month = date('m'); + $filePath = "{$tenantId}/daily-work-log/{$year}/{$month}/{$storedName}"; Storage::disk('tenant')->put($filePath, file_get_contents($file));