From cb78451d6c24e1ab993c9839dc4e172b346b4315 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 22 Feb 2024 16:13:54 +0000 Subject: [PATCH] Made website searchable on users table Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 4 ++++ app/Models/User.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index dad0954f6e..6d32e8b6f2 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -123,6 +123,10 @@ class UsersController extends Controller $users = $users->where('users.country', '=', $request->input('country')); } + if ($request->filled('website')) { + $users = $users->where('users.website', '=', $request->input('website')); + } + if ($request->filled('zip')) { $users = $users->where('users.zip', '=', $request->input('zip')); } diff --git a/app/Models/User.php b/app/Models/User.php index 85a17b16d5..f739ef8b0f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -67,6 +67,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'gravatar', 'vip', 'autoassign_licenses', + 'website', ]; protected $casts = [ @@ -120,6 +121,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo 'phone', 'jobtitle', 'employee_num', + 'website', ]; /**