diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index cf6d2213f84f..7bad468ffde8 100644 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -391,7 +391,7 @@ public function every($key, $operator = null, $value = null) public function except($keys) { if ($keys instanceof self) { - $keys = $keys->keys()->all(); + $keys = $keys->all(); } elseif (! is_array($keys)) { $keys = func_get_args(); } diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index 8616766a2b55..68704911325e 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -974,11 +974,11 @@ public function testExcept() $this->assertEquals(['first' => 'Taylor'], $data->except(['last', 'email', 'missing'])->all()); $this->assertEquals(['first' => 'Taylor'], $data->except('last', 'email', 'missing')->all()); - $this->assertEquals(['first' => 'Taylor'], $data->except(collect(['last' => 'Otwell', 'email' => 'taylorotwell@gmail.com', 'missing']))->all()); + $this->assertEquals(['first' => 'Taylor'], $data->except(collect(['last', 'email', 'missing']))->all()); $this->assertEquals(['first' => 'Taylor', 'email' => 'taylorotwell@gmail.com'], $data->except(['last'])->all()); $this->assertEquals(['first' => 'Taylor', 'email' => 'taylorotwell@gmail.com'], $data->except('last')->all()); - $this->assertEquals(['first' => 'Taylor', 'email' => 'taylorotwell@gmail.com'], $data->except(collect(['last' => 'Otwell']))->all()); + $this->assertEquals(['first' => 'Taylor', 'email' => 'taylorotwell@gmail.com'], $data->except(collect(['last']))->all()); } public function testPluckWithArrayAndObjectValues()