protected function castValue()
    {
        $value = $this->attributes['meta_value'];

        $validTypes = ['boolean', 'integer', 'float', 'double', 'array', 'object', 'null'];

        if (in_array($this->attributes['meta_type'], $validTypes)) {
            settype($value, $this->attributes['meta_type']);
        }

        return $value;
    }