protected function getCountry(Request $request)
    {
        if($request->headers->get('CF-IPCountry'))
        {
            return strtolower($request->headers->get('CF-IPCountry'));
        }
        // @codeCoverageIgnoreStart
        if(is_callable('geoip_country_code_by_name'))
        {
            if($countryCode = @geoip_country_code_by_name($request->getClientIp()))
            {
                return strtolower($countryCode);
            }
        }
        // @codeCoverageIgnoreEnd


        return 'unknown';
    }
protected function getCountry(Request $request)
    {
        if($request->headers->get('CF-IPCountry'))
        {
            return strtolower($request->headers->get('CF-IPCountry'));
        }
        // @codeCoverageIgnoreStart
        if(is_callable('geoip_country_code_by_name'))
        {
            if($countryCode = @geoip_country_code_by_name($request->getClientIp()))
            {
                return strtolower($countryCode);
            }
        }
        // @codeCoverageIgnoreEnd


        return 'unknown';
    }
protected function getCountry ( Request $ request ) { if ( $ request -> headers -> get ( 'CF-IPCountry' ) ) { return strtolower ( $ request -> headers -> get ( 'CF-IPCountry' ) ) ; } // @codeCoverageIgnoreStart if ( is_callable ( 'geoip_country_code_by_name' ) ) { if ( $ countryCode = @ geoip_country_code_by_name ( $ request -> getClientIp ( ) ) ) { return strtolower ( $ countryCode ) ; } } // @codeCoverageIgnoreEnd return 'unknown' ; }
Detect country based on IP

@return string
Detect country based on IP