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']);