Illuminate\Support\Collection::offsetUnset PHP Method

offsetUnset() public method

Unset the item at a given offset.
public offsetUnset ( string $key ) : void
$key string
return void
    public function offsetUnset($key)
    {
        unset($this->items[$key]);
    }

Usage Example

Exemplo n.º 1
0
 public function offsetUnset($key)
 {
     $keySegments = explode('.', $key);
     $firstKeySegment = array_shift($keySegments);
     if ($keySegments && $this->offsetExists($firstKeySegment)) {
         return parent::offsetGet($firstKeySegment)->items()->offsetUnset(implode('.', $keySegments));
     } else {
         return parent::offsetUnset($key);
     }
 }
All Usage Examples Of Illuminate\Support\Collection::offsetUnset