location icon indicating copy to clipboard operation
location copied to clipboard

Detect a users location by their IP Address.

Results 8 location issues
Sort by recently updated
recently updated
newest added

namespace App\Http\Controllers; use GeoIp2\Record\Location; use Illuminate\Http\Request; use App\Traits\ValidateTrait; class TestController extends Controller { use ValidateTrait; public function index(Request $request) { $ip = request()->ip(); $position = Location::get($ip); return $position; } }

Hi, When I try to make a call to Location in my controller, I always get this error message. I have added the ServiceProvider and the Alias in my App.php...

Hey there Getting the above error. I have published the config file and cleared cache. Any ideas?

I think it would be helpful to have a simple example of the output of Location::get() in the README file.

enhancement

I am trying to get location by $request->ip() and it is returning false on server.

PharData has FilesystemIterator::UNIX_PATHS flag as default in constructor (https://www.php.net/manual/en/phardata.construct.php, https://www.php.net/manual/en/class.filesystemiterator.php#filesystemiterator.constants.unix-paths). However, ‎DIRECTORY_SEPARATOR is used in https://github.com/stevebauman/location/blob/c95c397bf54a109f9cdb335377887047408dc8bc/src/Drivers/MaxMind.php#L45 which fails to retrieve valid $relativePath on Windows.

bug

It seems the area code is implemented differently in several drivers. Some drivers are returning the region/state such as `CA` and some are returning real area codes like phone numbers...

### Bug I'm trying to make use of the LOCATION_TESTING boolean in my env file to set an IP address manually whilst on localhost but it doesn't have any effect....