diff --git a/src/ModelCollection.php b/src/ModelCollection.php index d45f0d2..5634989 100644 --- a/src/ModelCollection.php +++ b/src/ModelCollection.php @@ -14,6 +14,9 @@ */ class ModelCollection implements Iterator, Countable, ArrayAccess { + /** + * @var TModel[] + */ protected array $models; protected int $iterator = 0; @@ -142,4 +145,13 @@ public function offsetUnset(mixed $offset): void unset($this->models[$offset]); } + /** + * Get the models in this collection as an array + * + * @return TModel[] + */ + public function getModels(): array + { + return $this->models; + } }