src/Chronos/Content/app/Models/ContentField.php
public function getValuesParsedAttribute()
    {
        if ($this->attributes['data'] == '')
            return null;

        $data = unserialize($this->attributes['data']);

        if (!isset($data['values']))
            return null;
        else {
            $values = preg_split("/\\r\\n|\\r|\\n/", $data['values']);
            $ret = [];

            foreach ($values as $item) {
                if (strpos($item, '=>')) {
                    $item = str_replace(' => ', '=>', $item);
                    list($key, $value) = explode('=>', $item);

                    $ret[$key] = $value;
                } else {
                    $ret[$item] = $item;
                }
            }

            return $ret;
        }
    }
public function getValuesParsedAttribute()
    {
        if ($this->attributes['data'] == '')
            return null;

        $data = unserialize($this->attributes['data']);

        if (!isset($data['values']))
            return null;
        else {
            $values = preg_split("/\\r\\n|\\r|\\n/", $data['values']);
            $ret = [];

            foreach ($values as $item) {
                if (strpos($item, '=>')) {
                    $item = str_replace(' => ', '=>', $item);
                    list($key, $value) = explode('=>', $item);

                    $ret[$key] = $value;
                } else {
                    $ret[$item] = $item;
                }
            }

            return $ret;
        }
    }
public function getValuesParsedAttribute ( ) { if ( $ this -> attributes [ 'data' ] == '' ) return null ; $ data = unserialize ( $ this -> attributes [ 'data' ] ) ; if ( ! isset ( $ data [ 'values' ] ) ) return null ; else { $ values = preg_split ( "/\\r\\n|\\r|\\n/" , $ data [ 'values' ] ) ; $ ret = [ ] ; foreach ( $ values as $ item ) { if ( strpos ( $ item , '=>' ) ) { $ item = str_replace ( ' => ' , '=>' , $ item ) ; list ( $ key , $ value ) = explode ( '=>' , $ item ) ; $ ret [ $ key ] = $ value ; } else { $ ret [ $ item ] = $ item ; } } return $ ret ; } }
Add parsed values to model.
Add parsed values to model .