public function getService()
    {
        if ($this->service === null) {
            // Get service configuration
            $config = $this->config('services.' . $this->config('service'), []);

            // Get service class
            $class = Arr::pull($config, 'class');

            // Sanity check
            if ($class === null) {
                throw new Exception('The GeoIP service is not valid.');
            }

            // Create service instance
            $this->service = new $class($config);
        }

        return $this->service;
    }
public function getService()
    {
        if ($this->service === null) {
            // Get service configuration
            $config = $this->config('services.' . $this->config('service'), []);

            // Get service class
            $class = Arr::pull($config, 'class');

            // Sanity check
            if ($class === null) {
                throw new Exception('The GeoIP service is not valid.');
            }

            // Create service instance
            $this->service = new $class($config);
        }

        return $this->service;
    }
public function getService ( ) { if ( $ this -> service === null ) { // Get service configuration $ config = $ this -> config ( 'services.' . $ this -> config ( 'service' ) , [ ] ) ; // Get service class $ class = Arr :: pull ( $ config , 'class' ) ; // Sanity check if ( $ class === null ) { throw new Exception ( 'The GeoIP service is not valid.' ) ; } // Create service instance $ this -> service = new $ class ( $ config ) ; } return $ this -> service ; }
Get service instance.

@return \Torann\GeoIP\Contracts\ServiceInterface
@throws Exception
Get service instance .