From 52d44e5571eac21b8f5028a2a255110c48bb613e Mon Sep 17 00:00:00 2001 From: Ronald-pro <36841157+Ronald-pro@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:44:33 +0300 Subject: [PATCH 1/4] change on the facility directory search --- app/Http/Controllers/DirectoryController.php | 14 +++++ app/Models/DirectoryLog.php | 17 ++++++ resources/views/directory/search.blade.php | 62 +++++++++++++++++++- routes/web.php | 4 ++ 4 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 app/Models/DirectoryLog.php diff --git a/app/Http/Controllers/DirectoryController.php b/app/Http/Controllers/DirectoryController.php index c0be76d..b1a2390 100644 --- a/app/Http/Controllers/DirectoryController.php +++ b/app/Http/Controllers/DirectoryController.php @@ -4,6 +4,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Http; +use App\Models\DirectoryLog; class DirectoryController extends Controller { @@ -25,4 +26,17 @@ public function directory(Request $request, $facility) return response()->json(['error' => 'API request failed'], $response->status()); } } + public function directoryLog(Request $request) + { + $searchTerm = $request->input('search_term'); + $resultCount = $request->input('result_count'); + + // Save the log + DirectoryLog::create([ + 'search_term' => $searchTerm, + 'result_count' => $resultCount, + ]); + + return response()->json(['status' => 'success']); + } } diff --git a/app/Models/DirectoryLog.php b/app/Models/DirectoryLog.php new file mode 100644 index 0000000..1a8bc66 --- /dev/null +++ b/app/Models/DirectoryLog.php @@ -0,0 +1,17 @@ + + @@ -30,9 +31,14 @@ .logo { max-height: 50px; - /* Set the max height of your logo */ } +
@@ -57,8 +63,9 @@