/** * Pulls an item from the collection. * * @param mixed $key * @param mixed $default * * @return mixed */ public function pull($key, $default = null) { return Arr::pull($this->items, $key, $default); }
public function testPull() { $array = ['name' => 'Desk', 'price' => 100]; $name = Arr::pull($array, 'name'); $this->assertEquals('Desk', $name); $this->assertEquals(['price' => 100], $array); }