PHPackages                             divineomega/laravel-geolocation-request - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. divineomega/laravel-geolocation-request

Abandoned → [jord-jd/laravel-geolocation-request](/?search=jord-jd%2Flaravel-geolocation-request)Library[Utility &amp; Helpers](/categories/utility)

divineomega/laravel-geolocation-request
=======================================

Laravel Geolocation Request

v2.0.0(2mo ago)3931[1 issues](https://github.com/Jord-JD/laravel-geolocation-request/issues)LGPL-3.0-onlyPHPPHP &gt;=7.1CI failing

Since Jul 6Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/laravel-geolocation-request)[ Packagist](https://packagist.org/packages/divineomega/laravel-geolocation-request)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-laravel-geolocation-request/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Laravel Geolocation Request
===========================

[](#laravel-geolocation-request)

The Laravel Geolocation Request package provides an easy way to geolocate requests to their country of origin, simply by calling a `$request->country()` method.

Installation
------------

[](#installation)

To install the Laravel Geolocation Request package, just run the following Composer command.

```
composer require jord-jd/laravel-geolocation-request
```

Usage
-----

[](#usage)

To use geolocation enabled requests within your Laravel controller methods, you can replace the `use Illuminate\Http\Request` line at the top of your controllers, as shown in the usage example below.

Once done, you can simple call the `$request->country()` method to perform geolocation and return the origin country of the active request based on its IP address. The country is returned as an object containing many properties, such as the country name and ISO codes.

```
