diff --git a/app/Models/Traits/Searchable.php b/app/Models/Traits/Searchable.php index 3661c66226..db46e305df 100644 --- a/app/Models/Traits/Searchable.php +++ b/app/Models/Traits/Searchable.php @@ -162,6 +162,10 @@ trait Searchable $query->orWhere($table.'.'.$column, 'LIKE', '%'.$term.'%'); } } + // I put this here because I only want to add the concat one time in the end of the user relation search + if($relation == 'user') { + $query->orWhereRaw('CONCAT (users.first_name, " ", users.last_name) LIKE ?', ["%$term%"]); + } }); }