protected function parseReadData($data)
    {
        $results = [];

        foreach ($data as $row) {
            if (is_array($row)) {
                $key = $row[$this->keyColumn];
                $value = $this->parseKeyValue($row[$this->valueColumn]);
            }
            elseif (is_object($row)) {
                $key = $row->{$this->keyColumn};
                $value = $this->parseKeyValue($row->{$this->valueColumn});
            }
            else {
                throw new UnexpectedValueException('Expected array or object, got '.gettype($row));
            }

            Arr::set($results, $key, $value);
        }

        return $results;
    }
protected function parseReadData($data)
    {
        $results = [];

        foreach ($data as $row) {
            if (is_array($row)) {
                $key = $row[$this->keyColumn];
                $value = $this->parseKeyValue($row[$this->valueColumn]);
            }
            elseif (is_object($row)) {
                $key = $row->{$this->keyColumn};
                $value = $this->parseKeyValue($row->{$this->valueColumn});
            }
            else {
                throw new UnexpectedValueException('Expected array or object, got '.gettype($row));
            }

            Arr::set($results, $key, $value);
        }

        return $results;
    }
protected function parseReadData ( $ data ) { $ results = [ ] ; foreach ( $ data as $ row ) { if ( is_array ( $ row ) ) { $ key = $ row [ $ this -> keyColumn ] ; $ value = $ this -> parseKeyValue ( $ row [ $ this -> valueColumn ] ) ; } elseif ( is_object ( $ row ) ) { $ key = $ row -> { $ this -> keyColumn } ; $ value = $ this -> parseKeyValue ( $ row -> { $ this -> valueColumn } ) ; } else { throw new UnexpectedValueException ( 'Expected array or object, got ' . gettype ( $ row ) ) ; } Arr :: set ( $ results , $ key , $ value ) ; } return $ results ; }
Parse data coming from the database.

@param  \Illuminate\Support\Collection $data

@return array
Parse data coming from the database .