Overtrue\Validation\Validator::getAttributeType PHP Method

getAttributeType() protected method

Get the data type of the given attribute.
protected getAttributeType ( string $attribute ) : string
$attribute string
return string
    protected function getAttributeType($attribute)
    {
        // We assume that the attributes present in the file array are files so that
        // means that if the attribute does not have a numeric rule and the files
        // list doesn't have it we'll just consider it a string by elimination.
        if ($this->hasRule($attribute, $this->numericRules)) {
            return 'numeric';
        } elseif ($this->hasRule($attribute, ['Array'])) {
            return 'array';
        } elseif (array_key_exists($attribute, $this->files)) {
            return 'file';
        }
        return 'string';
    }
Validator