We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a46895 commit f03072aCopy full SHA for f03072a
src/Traits/Arrayable.php
@@ -10,7 +10,7 @@ trait Arrayable
10
11
public static function makeAttribute(array $attributes = [])
12
{
13
- $instance = new class implements \ArrayAccess
+ $instance = new class implements \ArrayAccess, \IteratorAggregate
14
15
use Arrayable;
16
};
@@ -71,4 +71,9 @@ public function toArray()
71
72
return $this->getAttributes();
73
}
74
+
75
+ public function getIterator(): \ArrayIterator
76
+ {
77
+ return new \ArrayIterator($this->toArray());
78
+ }
79
0 commit comments