GeoLocation-Package - This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

Overview

GeoLocation in PHP (API) ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜

This package helps you to know a lot of information about the current user by his ip address ๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜

This package helps you to know the current language of the user, the country from which he is browsing, the currency of his country, and also whether he is using it vpn

GeoLocation

##Usage

There is no need to additional setup to start using, once you install it via composer you can call the Facade:

<?php

use Abdullah\UserGeoLocation\GeoLocation;

$user_ip = request()->ip();

$userInfo = new GeoLocation($user_ip);

echo $userInfo->getUserIP();
result : 141.201.183.207

you can chain on object 
to get all information about user like this

dd($userInfo->getUserInfo());

result : Abdullah\UserGeoLocation\GeoLocation {#281 โ–ผ
  -Service_url: "http://ip-api.com/php/"
  -USER_IP: "41.46.3.168"
  -Query: "status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query โ—€"
  -USER_INFO: array:24 [โ–ผ
    "status" => "success"
    "continent" => "Africa"
    "continentCode" => "AF"
    "country" => "Egypt"
    "countryCode" => "EG"
    "region" => "C"
    "regionName" => "Cairo Governorate"
    "city" => "Cairo"
    "district" => ""
    "zip" => ""
    "lat" => 30.0**
    "lon" => 31.28**
    "timezone" => "Africa/Cairo"
    "offset" => 7200
    "currency" => "EGP"
    "isp" => "TE Data"
    "org" => ""
    "as" => "AS8452 TE-AS"
    "asname" => "TE-AS"
    "reverse" => "host-41.4**.3.1**.tedata.net"
    "mobile" => false
    "proxy" => false
    "hosting" => false
    "query" => "4*.4*.3.1**"
  ]
}

you can get spacific value from response 
like this 

dd($userInfo->getUserSpecificValue('country'));

result : "Egypt"

or you can give it array and its work too
like this 

dd($userInfo->getUserSpecificValue(['country','city']));

result : array:2 [โ–ผ
  "country" => "Egypt"
  "city" => "Cairo"
]

you can change defult Query info about user to what you need 
as you like you can publish and change Query 
and you can also use it like string or array
first publish config dont forget

and change it from : 

 return [
    'Query' => 'status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query',
    'ServiceUrl' => 'http://ip-api.com/php/',
 ];

to (if you want city only for every user):

 return [
    'Query' => 'city',
    'ServiceUrl' => 'http://ip-api.com/php/',
 ];
 
 or like this array : 
 
  return [
    'Query' => ['status','message'],
    'ServiceUrl' => 'http://ip-api.com/php/',
 ];

to publish : php artisan vendor:publish 
and choose package to publish it

pakcage also auto-discovery

## Contribute!!

You are very welcomed if You want to Contribute ๐Ÿฅณ on that, And this is How :

- Fork The Repo.๐Ÿ“‚
- Create Your new Solution in a Class with The existing Name + your Name + your email . ๐Ÿš€

## License
MIT

** its for free usage you can fork it and enjoy **
You might also like...
This is a Composer plugin that provides an automated version of Country Codes database.
This is a Composer plugin that provides an automated version of Country Codes database.

Country Codes This is a Composer plugin that provides an automated version of Country Codes database. This database is include: country iso codes, cou

Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

Smeify is a Stable Automated Solution for Airtime and Data businesses in Nigeria, this package helps you integrate smeify easily into your laravel application.

A demo of how to use filament/forms to build a user-facing Form Builder which stores fields in JSON.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.
A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

A Laravel package helps you add a complete real-time messaging system to your new / existing application with only one command.

This Package helps you in laravel application to log all desired activity for each request from request entry point to generate response at a single snapshot.

Laravel Scenario Logger This Package helps you in laravel application to log all desired activity for each request from request entry point to generat

Laravel Grid is a package that helps you display table data.

Laravel Grid Laravel Grid is a package that helps you display table data. I could not find package that would satisfy my needs so I decided to write o

User authentication REST API with Laravel (Register, Email verification, Login, Logout, Logged user data, Change password, Reset password)

User Authentication API with Laravel This project is a user authentication REST API application that I developed by using Laravel and MySql. Setup Fir

Searches for multilingual phrases in Laravel project and automatically generates language files for you.
Searches for multilingual phrases in Laravel project and automatically generates language files for you.

Laravel Lang Generator Searches for multilingual phrases in a Laravel project and automatically generates language files for you. You can search for n

Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.
Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.

OvalFi Laravel Package Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App. Installation You can in

Releases(v1.0.0)
Owner
Abdullah Karam
php developer interested in learning every thing about software industry
Abdullah Karam
Atom VPN package for Laravel

Atom VPN package for Laravel What It Does This package allows you to manage user permissions and roles in a database. Once installed you can do stuff

Dubinskii Artem 6 Oct 11, 2022
Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard

Laravel Seo Tools Laravel is becoming more and more popular and lots of web application are developing. In most of the web application there need some

Tuhin Bepari 130 Dec 23, 2022
A Pocketmine 4.0 Plugin which makes your server query = Current players + 1 Total Slots

The Better-Query Plugin This Plugin implements Better Query System **(i.e. 0/1 as player count)** the server total slots increases by 1 after a player

RealBJsingh 3 May 14, 2022
This package helps you to add user based follow system to your model.

Laravel Follow User follow unfollow system for Laravel. Related projects: Like: overtrue/laravel-like Favorite: overtrue/laravel-favorite Subscribe: o

ๅฎ‰ๆญฃ่ถ… 1k Dec 31, 2022
๐Ÿ›‚ Use this package to validate the identity card from your country using laravel validation rules.

Identity Card Checker Laravel Validation Rules Use this package to validate the identity card number from your country Installation You can install th

David Torralbo Pรฉrez 13 Feb 8, 2022
Example of using TALL stack to select country phone code.

Select country phone code using TALL stack About Example of using TALL stack to select country phone code. Each item represents a country. Each item h

Fernando Chagas 3 Jul 27, 2022
This is a plugin written in the PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform. It helps to liven up your server with Tags!

General This is a plugin written in the PHP programming language and running on the PocketMine platform that works stably on the API 3.25.0 platform.

Thร nh Nhรขn 4 Oct 21, 2021
Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.

Laravel Countries Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries. Please

Christoph Kempen 695 Dec 30, 2022
Tiny Laravel worldwide currency formatter

Laravel Currency Formatter Tiny Laravel worldwide currency formatter Install composer require magarrent/laravel-currency-formatter Usage use Magarrent

Marc Garcia Torrent 17 Oct 5, 2022
Check Exchange Rates for any currency in Laravel.

Exchange Check exchange rates for any currency in Laravel If your app supports multi-currency, you'll no doubt need to check exchange rates. There are

Worksome 94 Oct 9, 2022