Skip to content

Commit fd6d4bf

Browse files
authored
Update Arrayable.php
1 parent f03072a commit fd6d4bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Traits/Arrayable.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait Arrayable
1010

1111
public static function makeAttribute(array $attributes = [])
1212
{
13-
$instance = new class implements \ArrayAccess, \IteratorAggregate
13+
$instance = new class implements \ArrayAccess, \IteratorAggregate, \Countable
1414
{
1515
use Arrayable;
1616
};
@@ -76,4 +76,9 @@ public function getIterator(): \ArrayIterator
7676
{
7777
return new \ArrayIterator($this->toArray());
7878
}
79+
80+
public function count()
81+
{
82+
return count($this->toArray());
83+
}
7984
}

0 commit comments

Comments
 (0)