entity/traits/Properties.php
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;
    }
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;
    }
Determine whether an attribute should be cast to a native type.

@param  string $property
@param  array|string|null $types
@return bool