public function hasCast($property, $types = null)
    {
        if (array_key_exists($property, $this->casts)) {
            return $types ? in_array($this->getCastType($property), (array)$types, true) : true;
        }

        return false;
    }