File tree 1 file changed +13
-4
lines changed
1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 3
3
namespace Laravel \Scout ;
4
4
5
5
use Illuminate \Container \Container ;
6
+ use Illuminate \Contracts \Support \Arrayable ;
6
7
use Illuminate \Pagination \LengthAwarePaginator ;
7
8
use Illuminate \Pagination \Paginator ;
8
9
use Illuminate \Support \Traits \Conditionable ;
@@ -146,11 +147,15 @@ public function where($field, $value)
146
147
* Add a "where in" constraint to the search query.
147
148
*
148
149
* @param string $field
149
- * @param array $values
150
+ * @param \Illuminate\Contracts\Support\Arrayable| array $values
150
151
* @return $this
151
152
*/
152
- public function whereIn ($ field , array $ values )
153
+ public function whereIn ($ field , $ values )
153
154
{
155
+ if ($ values instanceof Arrayable) {
156
+ $ values = $ values ->toArray ();
157
+ }
158
+
154
159
$ this ->whereIns [$ field ] = $ values ;
155
160
156
161
return $ this ;
@@ -160,11 +165,15 @@ public function whereIn($field, array $values)
160
165
* Add a "where not in" constraint to the search query.
161
166
*
162
167
* @param string $field
163
- * @param array $values
168
+ * @param \Illuminate\Contracts\Support\Arrayable| array $values
164
169
* @return $this
165
170
*/
166
- public function whereNotIn ($ field , array $ values )
171
+ public function whereNotIn ($ field , $ values )
167
172
{
173
+ if ($ values instanceof Arrayable) {
174
+ $ values = $ values ->toArray ();
175
+ }
176
+
168
177
$ this ->whereNotIns [$ field ] = $ values ;
169
178
170
179
return $ this ;
You can’t perform that action at this time.
0 commit comments