Skip to content

Commit 2a7163f

Browse files
Merge branch 'fix/fix-issue-when-no-where-in-values-are-provided' into dev
2 parents b75b54d + 917589a commit 2a7163f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: src/Database/Query/FMBaseBuilder.php

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use DateTimeInterface;
66
use GearboxSolutions\EloquentFileMaker\Exceptions\FileMakerDataApiException;
7+
use Illuminate\Contracts\Support\Arrayable;
78
use Illuminate\Database\Query\Builder;
89
use Illuminate\Http\File;
910
use Illuminate\Http\UploadedFile;
@@ -511,6 +512,10 @@ public function whereIn($column, $values, $boolean = 'and', $not = false)
511512
{
512513
throw_if($boolean === 'or', new \RuntimeException('Eloquent FileMaker does not currently support or within a where in'));
513514

515+
if ($values instanceof Arrayable) {
516+
$values = $values->toArray();
517+
}
518+
514519
$this->whereIns[] = [
515520
'column' => $this->getMappedFieldName($column),
516521
'values' => $values,
@@ -557,6 +562,10 @@ protected function computeWhereIns()
557562
return array_merge(...array_values($conditions));
558563
};
559564

565+
if (empty($arr)) {
566+
return;
567+
}
568+
560569
$this->wheres = array_map($function, $arr);
561570
}
562571

0 commit comments

Comments
 (0)