{"repo":"stevebauman/location","free":true,"listed":false,"github":"https://github.com/stevebauman/location","clone":"git clone https://github.com/stevebauman/location.git","description":"Retrieve a visitor's location from their IP address.","language":"PHP","stars":1305,"topics":["maxmind","php","location","laravel"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Location Retrieve a visitor's location from their IP address using various services (online & local). Index - Requirements - Installation - Usage - Testing - Drivers - Upgrading from v6 - Versioning Requirements - PHP = 8.1 - Laravel = 8.0 Installation Install location using composer require : Publish the configuration file (this will create a location.php file inside the config directory): Usage Retrieve a client's location Important : - This method retrieves the user's IP address via request()- ip() . - In the default configuration, testing.enabled is active, the returned IP address is in the USA. Disable it to get the client's real IP address. Retrieve the location of a specific IP address Testing You may call Location::fake with an array of IP address patterns and their expected positions to fake the location of an IP address: If you prefer, you may use an asterisk to return the same position for any IP address that is given: If no expectations are given, or an expectation is not matched, Location::get will return false : If your application attempts to retrieve the location's of multiple IP addresses, you may provide multiple IP address expectation patterns: You may also use an asterisk to fake several IP patterns: Drivers Available Drivers Available drivers: - IpApi - Default - IpApiPro - IpData - IpInfo - IpInfo Lite - Kloudend - GeoPlugin - MaxMind - Cloudflare - IP2Location.io Setting up MaxMind with a self-hosted database (optional) It is encouraged to set up MaxMin","default_branch":null,"files":null,"tree":[],"storefront":"/r/stevebauman","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/stevebauman/location/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}