Determine the geographical location of website visitors based on their IP addresses.

Overview
Comments
  • When CACHE_DRIVER=file =>

    When CACHE_DRIVER=file => "This cache store does not support tagging"

    Hi,

    When "CACHE_DRIVER=file" is receive this error: BadMethodCallException in Repository.php line 391: This cache store does not support tagging. in Repository.php line 391 at Repository->tags(array('torann-geoip-location')) in CacheManager.php line 301 at CacheManager->__call('tags', array(array('torann-geoip-location'))) in Cache.php line 32 at Cache->__construct(object(CacheManager), array('torann-geoip-location'), '30') in GeoIP.php line 91

    Unfortunatly, I must configure my cache this way to make it work: CACHE_DRIVER=array

    FYI, I'm upgrading from 0.2 to 1.0. Was working with "CACHE_DRIVER=file"

    Any ideas?

    opened by paceband 19
  • Class 'Torann\GeoIP\GeoIPFacade' not found

    Class 'Torann\GeoIP\GeoIPFacade' not found

    Not sure what I'm doing wrong here...

    Specs:

    • Laravel 5.4
    • Mac
    • "torann/geoip": "^1.0"
    • "geoip2/geoip2": "^2.4"

    Any ideas...

    app.php

       'providers' => [
    ...
            Torann\GeoIP\GeoIPServiceProvider::class,
    ...
    
        'aliases' => [
    ...
            'GeoIP' => Torann\GeoIP\GeoIPFacade::class,
    ...
    

    PagesController.php

    ...
    use Torann\GeoIP\GeoIPFacade as GeoIP; // I've tried this,
    use GeoIP as GeoIP;                    // this,
    use GeoIP;                             // and this...
    ...
    
    public function getHome()
        {
            ...
            $data['visits'] = Redis::incr('visits');
            $data['$location'] = GeoIP::getLocation();
            return View::make('pages.home', $data);
            ...
        }
    

    home.blade.php

    ...
    <!-- USER :: DATA -->
    <!-- Visit #{{ $visits }} -->
    <!-- {{ $location }} -->
    ...
    

    Error: Class 'Torann\GeoIP\GeoIPFacade' not found

    /Users/user/Sites/sogenius/vendor/laravel/framework/src/Illuminate/Foundation/AliasLoader.php
            if (static::$facadeNamespace && strpos($alias, static::$facadeNamespace) === 0) {
                $this->loadFacade($alias);
     
                return true;
            }
     
            if (isset($this->aliases[$alias])) {
                return class_alias($this->aliases[$alias], $alias);
            }
        }
    
    opened by sogeniusio 16
  • The GeoIP service is not valid.

    The GeoIP service is not valid.

    Hi all, I am using laravel 5.5. I have config on app.config for Provider and Aliases. When i call: $location = GeoIP::getLocation(); --> Bug: THe GeoIP service is not valid. (In GeoIP.php line 205)

    Help me!

    opened by hitechqb 9
  • Non-static method Torann\GeoIP\GeoIP::getLocation() should not be called statically, assuming $this from incompatible context

    Non-static method Torann\GeoIP\GeoIP::getLocation() should not be called statically, assuming $this from incompatible context

    Attempted to use this several different ways. Do I need to sign up for an external account in order to use this? Not very clear from the documentation - not sure if maxmind is optional or required. I also see that another issue was posted with the same error.

    Here is my test:

    // Routes.php
    use Torann\GeoIP\GeoIP;
    Route::get('geoip', function() {
        $location = GeoIP::getLocation();
    });
    
    opened by opheliadesign 9
  • Double ip address not returning proper location

    Double ip address not returning proper location

    Hello After much debug I discovered that my server is returning a double ip address for the remote ip. The remote ip looks like xxx.xxx.xxx.xxx, yyy.yyy.yyy.yyy and the resulting location is returned with default => 1

    The double IP is coming from an apache config involving reverse proxy and I have no control over it. Perhaps the package could account for it and just take the first ip?

    opened by rickshawhobo 8
  • Support for Laravel 7

    Support for Laravel 7

    Also some opinionated removal of PHP 7.1 and Laravel 5.5 support. The current version that supports Laravel 5.5 is stable and working, so let's move forward.

    opened by mikemand 7
  • Undefined method reference...

    Undefined method reference...

    Hi,

    I would just like to point out a reference to a method that does not (or no longer) exists..

    https://github.com/Torann/laravel-geoip/blob/d00e9b5b9c8e9c79c47fc4d78d4b47db1cd532c3/src/GeoIP.php#L164

    image

    Possible fix: https://github.com/Seldaek/monolog/commit/d686f25f6c1ce9706e23cf1c6f97c76e8bf83d09

    opened by PhoenixPeca 7
  • Allow dependency injection

    Allow dependency injection

    Allow dependency injection. To avoid using a global variable.

        use Torann\GeoIP\GeoIP;
    
        public function login(GeoIP $geoip)
        {
            return $geoip->getLocation($request->ip())->toArray();
        }
    
    opened by KaliaJS 6
  • Fix MaxMind database fetching

    Fix MaxMind database fetching

    This is a follow-up to #163 that is intended to fix #162.

    It expands on the work by @tylermann - with a couple of differences.

    Instead of adding the database filename to the config it searches for the first file with the extension .mmdb and assumes this is the correct one. Seems like a little simpler to me though less configurable - open to feedback here.

    It would be great if we could leverage Laravel's filesystem adapter as it would clean up much of the directory creation/removal code, but that's probably part of a larger discussion.

    opened by dwightwatson 6
  • Laravel 5.3 issue?

    Laravel 5.3 issue?

    Hello,

    I am getting the following:

    php artisan geoip:update The current service "Illuminate\Foundation\Application" does not support updating.

    Also, whenever I use the geoip helper I am getting:

    geoip('192.168.0.1');

    [Symfony\Component\Debug\Exception\FatalThrowableError]
    Call to undefined method Illuminate\Foundation\Application::hydrate()

    Any idea?

    opened by mendrinos 6
  • Support MaxMind country database

    Support MaxMind country database

    It would be great if this extension would support the usage of only the MaxMind country database as well (also for the Laravel 4 version), since the commercial version of it is much cheaper than the city database.

    opened by tholu 5
  • Support for both Country and City database for MAXMIND GeoIP2

    Support for both Country and City database for MAXMIND GeoIP2

    Right now there is only support for city Database for MAXMIND GeoIP2. A config for choosing any of those option would be much appreciated and versatile. This exception occurred when a country database is used.

    BadMethodCallException {#1783 ▼
      #message: "The city method cannot be used to open a GeoIP2-Country database"
      #code: 0
      #file: "/var/www/vendor/geoip2/geoip2/src/Database/Reader.php"
      #line: 254
    }
    
    opened by NilsBohr14 0
  • fix: temporary fix openssl issue on some machine

    fix: temporary fix openssl issue on some machine

    Hello,

    Php currently have an issue with openssl https://github.com/php/php-src/issues/8369,

    For some machine, file_get_contents and file_put_contents will fail, we could fix it with this approach https://github.com/guzzle/psr7/issues/504#issuecomment-1114693965, but I think it overkill for a simple database update command.

    I'll revert this commit sometime in the future when php got fix.

    opened by kocoten1992 0
  • Error: Declaration of Torann\GeoIP\Location::offsetExists(Torann\GeoIP\mixed $offset): bool must be compatible with ArrayAccess::offsetExists($offset)

    Error: Declaration of Torann\GeoIP\Location::offsetExists(Torann\GeoIP\mixed $offset): bool must be compatible with ArrayAccess::offsetExists($offset)

    Trying to get this working:

    • Laravel 8.0 on PHP 7.3.16-fpm
    • Installed laravel-geoip with Composer
    • Cache Driver to Array
    • Installed geoip2 with Composer
    • Set /config/geoip.php 'service' to use 'maxmind_database'
    • Created Maxmin account and added Maxmind credentials to .env
    // Running this
    $location = \GeoIP::getLocation(\Request::ip());
    
    // Gives me:
    Declaration of Torann\GeoIP\Location::offsetExists(Torann\GeoIP\mixed $offset): bool must be compatible with ArrayAccess::offsetExists($offset)
    
    opened by netm 0
  • geoip:update with maxmind_database uses too much memory

    geoip:update with maxmind_database uses too much memory

    I get:

    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 36864 bytes) in /var/app/current/vendor/torann/geoip/src/Services/MaxMindDatabase.php on line 78
    PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 131072 bytes) in /var/app/current/vendor/sentry/sentry/src/HttpClient/Plugin/GzipEncoderPlugin.php on line 53
    

    Perhaps we could use https://github.com/splitbrain/php-archive to reduce memory use?

    opened by jordanade 0
Releases(3.0.4)
Determine the geographical location of website visitors based on their IP addresses.

Determine the geographical location and currency of website visitors based on their IP addresses.

Daniel Stainback 1.9k Dec 22, 2022
This is a Location Registration For location registration

location-registration-system This is a Location Registration location-registration-system for users registration location if your location verifide Wi

masoudharooni 9 Feb 10, 2022
Server manager is a open source project made for people so that they can add the servers to one single place irrespective of their provider and manage it through one location.

Server Manager Are you sick of having to log into hundreads of different website just to access your server? Well we got you, Server manager is a open

null 8 Aug 9, 2022
laravel package help you to implement geographical calculation, with several algorithms that help you deal with coordinates and distances.

Geographical Calculator Geographical Calculator was developed for laravel 5.8+ to help you to implement geographical calculation, with With several al

karam mustafa 342 Dec 31, 2022
Divide / Split your WordPress Blog visitors into 4 links by using Re-skinning URL splitter

Re-skinning URL splitter Tool Divide / Split your Wordpress Blog visitors into 4 links by using Re-skinning URL splitter Re-skinning URL Splitter Feat

Mohammed cha 72 Nov 30, 2022
A WordPress plugin that displays proxied war news from the free world to Russian IP address visitors with option to block further access.

A WordPress plugin that displays proxied war news from the free world to Russian IP address visitors with option to block further access.

null 5 Jul 15, 2022
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

PHP Cron Expression Parser NOTE This fork has been deprecated and development moved to https://github.com/dragonmantank/cron-expression. More informat

Michael Dowling 4.9k Jan 5, 2023
Analyze content to determine the appropriate Internet media type

Canal Content analysis for the purpose of determining Internet media types. Requirements PHP 5.3+ Installation Through Composer as dflydev/canal. Usag

dflydev 34 Feb 11, 2022
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

Chris Tankersley 4.3k Jan 9, 2023
A PHP library to deal with all those media services around, parsing their URLs and displaying their audios/videos.

MediaEmbed A utility library that generates HTML embed tags for audio or video located on a given URL. It also parses and validates given media URLs.

Mark Sch. 165 Nov 10, 2022
A web application built on PHP for user to view their credit information in their mysql database

TheCreditInfo Table of Content About Inspiration Technologies Client Pages Usage About Credere is a website created to help you track your credit hist

Abdul-Baseet Shabi 0 Jul 21, 2022
Small PHP library to valid email addresses using a number of methods.

Email Validator Small PHP library to valid email addresses using a number of methods. Features Validates email address Checks for example domains (e.g

James Jackson 154 Dec 31, 2022
A library for IP addresses calculations

PHP IP tools This library provides tooling for IP address calculations based on rlanvin/php-ip Free IP blocks calculation Compute the best possible al

HiQDev 4 Mar 25, 2022
Laravel 8 Project Restrict User Access From IP Addresses. prevent other ip address that want to access over secure api or urls.

block-ip-address-laravel Laravel 8 Project Restrict User Access From IP Addresses. prevent other ip address that want to access over secure api or url

Hasmukh Dharajiya 2 Mar 24, 2022
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
Immutable value object for IPv4 and IPv6 addresses, including helper methods and Doctrine support.

IP is an immutable value object for (both version 4 and 6) IP addresses. Several helper methods are provided for ranges, broadcast and network address

Darsyn 224 Dec 28, 2022
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
A simple way to deploy your application to a remote location.

Deploy Plugin A simple way to deploy your application to a remote location. Currently in Active Development This plugin is incomplete. This plugin is

The Rain Lab 16 Nov 26, 2022
get nearby location by coordinate from eloquent laravel

LARAVEL-COORDINATE get nearby location data from database with eloquent laravel Installation composer require bagusindrayana/laravel-coordinate In M

Bagus Indrayana 26 Sep 9, 2022