public function pull($key = null, $default = null)
    {
        if (is_null($key)) {
            $value = $this->all();
            $this->clear();

            return $value;
        }

        $value = $this->get($key, $default);
        $this->delete($key);

        return $value;
    }
public function pull($key = null, $default = null)
    {
        if (is_null($key)) {
            $value = $this->all();
            $this->clear();

            return $value;
        }

        $value = $this->get($key, $default);
        $this->delete($key);

        return $value;
    }
public function pull ( $ key = null , $ default = null ) { if ( is_null ( $ key ) ) { $ value = $ this -> all ( ) ; $ this -> clear ( ) ; return $ value ; } $ value = $ this -> get ( $ key , $ default ) ; $ this -> delete ( $ key ) ; return $ value ; }
Return the value of a given key and
delete the key

@param  int|string|null $key
@param  mixed           $default
@return mixed
Return the value of a given key and delete the key