Code Duplication    Length = 10-10 lines in 2 locations

src/Modules/Core/BaseClasses/BaseRepository.php 2 locations

@@ 80-89 (lines=10) @@
77
            /**
78
             * Loop through the rest of the columns to construct or where conditions.
79
             */
80
            foreach ($conditionColumns as $column) {
81
                $column = 'LOWER('.$column.')';
82
                if (Str::contains($column, '->')) {
83
                    $column = $this->wrapJsonSelector($column);
84
                }
85
86
                $q->orWhere(\DB::raw($column), 'LIKE', '%'.strtolower($query).'%');
87
            }
88
89
            /**
90
             * Loop through the model relations.
91
             */
92
            foreach ($relations as $relation) {
@@ 129-138 (lines=10) @@
126
                            /**
127
                             * Loop through the rest of the columns to construct or where conditions.
128
                             */
129
                            foreach ($subConditionColumns as $subConditionColumn) {
130
                                $column = 'LOWER('.$subConditionColumn.')';
131
                                if (Str::contains($column, '->')) {
132
                                    $column = $this->wrapJsonSelector($column);
133
                                }
134
                                
135
                                $q->orWhere(\DB::raw($column), 'LIKE', '%'.strtolower($query).'%');
136
                            }
137
                        });
138
                    });
139
                }
140
            }
141
        });