protected function createDatabase()
    {
        $database = array_get($this->config, 'database', false);

        // check if file exists first
        if (! $database || ! file_exists($database)) {
            throw new InvalidCredentialsException();
        }

        // catch maxmind exception and throw geoip exception
        try {
            return new Reader($database);
        } catch (\MaxMind\Db\Reader\InvalidDatabaseException $e) {
            throw new InvalidDatabaseException($e->getMessage(), $e->getCode(), $e);
        }
    }
protected function createDatabase()
    {
        $database = array_get($this->config, 'database', false);

        // check if file exists first
        if (! $database || ! file_exists($database)) {
            throw new InvalidCredentialsException();
        }

        // catch maxmind exception and throw geoip exception
        try {
            return new Reader($database);
        } catch (\MaxMind\Db\Reader\InvalidDatabaseException $e) {
            throw new InvalidDatabaseException($e->getMessage(), $e->getCode(), $e);
        }
    }
protected function createDatabase ( ) { $ database = array_get ( $ this -> config , 'database' , false ) ; // check if file exists first if ( ! $ database || ! file_exists ( $ database ) ) { throw new InvalidCredentialsException ( ) ; } // catch maxmind exception and throw geoip exception try { return new Reader ( $ database ) ; } catch ( \ MaxMind \ Db \ Reader \ InvalidDatabaseException $ e ) { throw new InvalidDatabaseException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } }
Create the maxmind database reader.

@throws \PulkitJalan\GeoIP\Exceptions\InvalidCredentialsException

@return \GeoIp2\Database\Reader
Create the maxmind database reader .