From c15b2426d3e3ae4ff808cb4db0db7400ba9a15fc Mon Sep 17 00:00:00 2001 From: hskwon Date: Wed, 17 Dec 2025 19:04:14 +0900 Subject: [PATCH] =?UTF-8?q?API=20=EB=A1=9C=EA=B7=B8=20=ED=95=84=ED=84=B0?= =?UTF-8?q?=20=EA=B0=9C=EC=84=A0:=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EB=8B=A4=EC=A4=91=EC=84=A0=ED=83=9D,=20=EC=A6=89=EC=8B=9C=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ApiLogController.php | 9 +++++-- resources/views/api-logs/index.blade.php | 29 +++++++++++++++-------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/ApiLogController.php b/app/Http/Controllers/ApiLogController.php index be5da2de..73a19ee1 100644 --- a/app/Http/Controllers/ApiLogController.php +++ b/app/Http/Controllers/ApiLogController.php @@ -28,9 +28,14 @@ public function index(Request $request): View $query->orderByDesc('created_at'); // 최신순 } - // 필터: HTTP 메서드 + // 필터: HTTP 메서드 (다중 선택 가능) if ($request->filled('method')) { - $query->where('method', $request->method); + $methods = $request->input('method'); + if (is_array($methods)) { + $query->whereIn('method', $methods); + } else { + $query->where('method', $methods); + } } // 필터: 상태 코드 diff --git a/resources/views/api-logs/index.blade.php b/resources/views/api-logs/index.blade.php index 91afb2be..19c4b90a 100644 --- a/resources/views/api-logs/index.blade.php +++ b/resources/views/api-logs/index.blade.php @@ -80,22 +80,31 @@ +@php + $selectedMethods = request('method', []); + if (!is_array($selectedMethods)) { + $selectedMethods = $selectedMethods ? [$selectedMethods] : []; + } +@endphp
-
+
- +
+ @foreach(['GET', 'POST', 'PUT', 'PATCH', 'DELETE'] as $method) + + @endforeach +
-