src/Buonzz/GeoIP/GeoIP.php
private function retrievefromCache(){      
      
      if (class_exists('\\Cache'))
      {
        
        $cache_key = 'laravel-4-freegeoip-'. $this->ip;     

        if (\Cache::has($cache_key))
             $this->geoip_data = \Cache::get($cache_key);
          else
          {
              $this->geoip_data = $this->resolve($this->ip); 
              \Cache::put($cache_key, $this->geoip_data , 60*60);       
          }
      }
      else
           $this->geoip_data = $this->resolve($this->ip);
   }
private function retrievefromCache(){      
      
      if (class_exists('\\Cache'))
      {
        
        $cache_key = 'laravel-4-freegeoip-'. $this->ip;     

        if (\Cache::has($cache_key))
             $this->geoip_data = \Cache::get($cache_key);
          else
          {
              $this->geoip_data = $this->resolve($this->ip); 
              \Cache::put($cache_key, $this->geoip_data , 60*60);       
          }
      }
      else
           $this->geoip_data = $this->resolve($this->ip);
   }
private function retrievefromCache ( ) { if ( class_exists ( '\\Cache' ) ) { $ cache_key = 'laravel-4-freegeoip-' . $ this -> ip ; if ( \ Cache :: has ( $ cache_key ) ) $ this -> geoip_data = \ Cache :: get ( $ cache_key ) ; else { $ this -> geoip_data = $ this -> resolve ( $ this -> ip ) ; \ Cache :: put ( $ cache_key , $ this -> geoip_data , 60 * 60 ) ; } } else $ this -> geoip_data = $ this -> resolve ( $ this -> ip ) ; }
check if the Cache class exists and use caching mechanism if there is, otherwise just call the API directly.

@return void
check if the Cache class exists and use caching mechanism if there is otherwise just call the API directly .