Skip to content

Commit 7286c67

Browse files
author
David Nahodyl
committed
improved all() function to use the existing get() instead of going to the base query to improve result consistency between method calls, particularly with global scopes
1 parent e9c5ff3 commit 7286c67

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Database/Eloquent/FMEloquentBuilder.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public function setModel($model, $ids = [])
5252
return $this;
5353
}
5454

55+
/**
56+
* @return Collection
57+
* @throws FileMakerDataApiException
58+
*/
5559
public function all()
5660
{
5761
// Set the limit if the user hasn't already set one
@@ -62,9 +66,7 @@ public function all()
6266
$this->query->limit(1000000000000000000);
6367
}
6468

65-
$records = $this->query->get();
66-
$models = $this->model->createModelsFromRecordSet($records);
67-
return $models;
69+
return $this->get();
6870
}
6971

7072

0 commit comments

Comments
 (0)