private function getValue($value)
    {
        switch ($this->attributes['type']) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'collection':
                return new Collection(json_decode($value, true));
            case 'object':
                return json_decode($value);
            case 'array':
                return json_decode($value, true);
            default:
                return $value;
        }
    }
private function getValue($value)
    {
        switch ($this->attributes['type']) {
            case 'int':
            case 'integer':
                return (int) $value;
            case 'real':
            case 'float':
            case 'double':
                return (float) $value;
            case 'bool':
            case 'boolean':
                return (bool) $value;
            case 'collection':
                return new Collection(json_decode($value, true));
            case 'object':
                return json_decode($value);
            case 'array':
                return json_decode($value, true);
            default:
                return $value;
        }
    }
private function getValue ( $ value ) { switch ( $ this -> attributes [ 'type' ] ) { case 'int' : case 'integer' : return ( int ) $ value ; case 'real' : case 'float' : case 'double' : return ( float ) $ value ; case 'bool' : case 'boolean' : return ( bool ) $ value ; case 'collection' : return new Collection ( json_decode ( $ value , true ) ) ; case 'object' : return json_decode ( $ value ) ; case 'array' : return json_decode ( $ value , true ) ; default : return $ value ; } }
Internal function utilized by getValueAttribute to get raw results from the db and format as they were set during insertion.

@param $value
@return bool|float|Collection|int|mixed
Internal function utilized by getValueAttribute to get raw results from the db and format as they were set during insertion .