Illuminate\Support\Collection::diffKeys PHP Метод

diffKeys() публичный Метод

Get the items in the collection whose keys are not present in the given items.
public diffKeys ( mixed $items ) : static
$items mixed
Результат static
    public function diffKeys($items)
    {
        return new static(array_diff_key($this->items, $this->getArrayableItems($items)));
    }

Usage Example

Пример #1
0
 public function testDiffKeys()
 {
     $c1 = new Collection(['id' => 1, 'first_word' => 'Hello']);
     $c2 = new Collection(['id' => 123, 'foo_bar' => 'Hello']);
     $this->assertEquals(['first_word' => 'Hello'], $c1->diffKeys($c2)->all());
 }