/** * Get all items except for those with the specified keys. * * @param mixed $keys * * @return static */ public function except($keys) { $keys = is_array($keys) ? $keys : func_get_args(); return new static(Arr::except($this->items, $keys)); }
public function testExcept() { $array = ['name' => 'Desk', 'price' => 100]; $array = Arr::except($array, ['price']); $this->assertEquals(['name' => 'Desk'], $array); }