From d65efa5b5b1cd91ed3f40425e1c509b44c7cae2f Mon Sep 17 00:00:00 2001 From: Mohammad Hafijul Islam Date: Fri, 27 Sep 2024 02:15:36 +0600 Subject: [PATCH] master search issue fixed --- src/Repositories/Eloquent/UserRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Repositories/Eloquent/UserRepository.php b/src/Repositories/Eloquent/UserRepository.php index 325ad28..25c85e2 100644 --- a/src/Repositories/Eloquent/UserRepository.php +++ b/src/Repositories/Eloquent/UserRepository.php @@ -97,6 +97,12 @@ public function list(array $filters = []) }); } + if (!empty($filters['country_id'])) { + $query->whereHas('profile', function (Builder $builder) use (&$filters) { + return $builder->where('present_country_id', '=', $filters['country_id']); + }); + } + if (!empty($filters['role_name'])) { $query->whereHas('roles', function (Builder $builder) use (&$filters) { return $builder->where('name', '=', $filters['role_name']);