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

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

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

Usage Example

Пример #1
0
 public function testDiffNull()
 {
     $c = new Collection(['id' => 1, 'first_word' => 'Hello']);
     $this->assertEquals(['id' => 1, 'first_word' => 'Hello'], $c->diff(null)->all());
 }
All Usage Examples Of Illuminate\Support\Collection::diff