Esempio n. 1
0
 /**
  * Get a flattened array of the items in the collection.
  *
  * @return static
  */
 public function flatten()
 {
     return new static(Arr::flatten($this->items));
 }
Esempio n. 2
0
 public function testFlatten()
 {
     $array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']];
     $array = Arr::flatten($array);
     $this->assertEquals(['Joe', 'PHP', 'Ruby'], $array);
 }