Download the PHP package divineomega/laravel-geolocation-request without Composer
On this page you can find all versions of the php package divineomega/laravel-geolocation-request. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download divineomega/laravel-geolocation-request
More information about divineomega/laravel-geolocation-request
Files in divineomega/laravel-geolocation-request
Package laravel-geolocation-request
Short Description Laravel Geolocation Request
License LGPL-3.0-only
Informations about the package 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
To install the Laravel Geolocation Request package, just run the following Composer command.
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.
If you are using custom request objects, you can
change them to extend the provided GeolocationRequest
class.
If you unable to extend your custom request object, or
simply do not wish to, you can add geolocation functionality
by using the provided GeolocatableRequest
trait.
All versions of laravel-geolocation-request with dependencies
laravel/framework Version ^5.6||^6.0||^7.0||^8.0
divineomega/php-geolocation Version ^2.0
divineomega/do-file-cache-psr-6 Version ^2.0