protected function extractParameters($attribute, array $parameters, array $data)
    {
        $parameters = array_map('strtolower', $parameters);

        // Discover if an input field was provided. If not, guess the field's name.
        $inputField = Collection::make($parameters)
                                ->intersect(array_keys(Arr::dot($data)))
                                ->first() ?: "${attribute}_country";

        // Attempt to retrieve the field's value.
        if ($inputCountry = Arr::get($data, $inputField)) {

            if (static::isValidType($inputField)) {
                throw InvalidParameterException::ambiguous($inputField);
            }

            // Invalid country field values should just validate to false.
            // This will also prevent parameter hijacking through the country field.
            if (static::isValidCountryCode($inputCountry)) {
                $parameters[] = $inputCountry;
            }
        }

        return [
            static::parseCountries($parameters),
            static::parseTypes($parameters),
            in_array('auto', $parameters),
            in_array('lenient', $parameters)
        ];
    }