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 +
-