Download the PHP package yebto/laravel-geoip-api without Composer
On this page you can find all versions of the php package yebto/laravel-geoip-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-geoip-api
Laravel GeoIP API SDK
Official Laravel SDK for the YEB GeoIP API by NETOX Ltd. — a lightweight wrapper for fast and accurate IP geolocation (City, Country, ASN) in Laravel applications.
Table of Contents
- Installation
- Usage
- Available Methods
- Parameters Reference
- Configuration
- Features
- Free Tier Access
- Troubleshooting
- Support
- License
Installation
Install the package using Composer:
Publish the configuration file:
Add your API key to your .env file:
Usage
Import the facade and start making API calls:
Examples
1) City Lookup
2) Country Lookup
3) ASN Lookup
4) Generic Query
💡 If the IP is omitted (e.g.
GeoIPAPI::city();), the backend uses the requester's IP automatically viaRequest::ip().
5) Error Handling
Available Methods
GeoIPAPI::city(?string $ip = null)– API DocsGeoIPAPI::country(?string $ip = null)– API DocsGeoIPAPI::asn(?string $ip = null)– API DocsGeoIPAPI::query(string $db, ?string $ip = null)– API Docs
Parameters Reference
| Helper | Required | Optional |
|---|---|---|
city |
ip (when not auto-detected) |
– |
country |
ip (when not auto-detected) |
– |
asn |
ip (when not auto-detected) |
– |
query |
db (city | country | asn) |
ip (when not auto-detected) |
💡 All methods accept additional parameters supported by the API, which will be forwarded transparently.
Configuration
The SDK uses a single environment variable:
You may customize other configuration settings via config/geoipapi.php after publishing:
Features
- Simple, expressive API via a Laravel Facade
- City, Country, and ASN lookups
- Auto-detects the requester IP when omitted
- Small footprint — no local databases to maintain
- Customizable cURL options (timeouts, user agent, etc.)
- Clean error handling with
RuntimeExceptionon failed requests - Built for Laravel; zero-config auto-discovery
Free Tier Access
🎁 Get 1,000+ free API requests by registering on yeb.to using your Google account.
Steps:
- Visit https://yeb.to
- Click Login with Google
- Retrieve your API key and add it to
.envasYEB_KEY_ID
No credit card required!
Troubleshooting
- Ensure your API key is correct and active (
YEB_KEY_ID) - Double-check that the config file is published (
php artisan vendor:publish --tag=geoipapi-config) - Validate parameters against the API reference
- Check for typos in method names or required fields
- Consider adjusting
CURLOPT_TIMEOUTinconfig/geoipapi.phpfor slower networks - Inspect your application/network firewall rules if requests time out
Support
- 📘 API Documentation: https://yeb.to/api/geoip
- 📧 Email: [email protected]
- 🐛 Issues: https://github.com/yebto/laravel-geoip-api/issues
License
© NETOX Ltd. Licensed under a proprietary or custom license unless stated otherwise in the repository.
💬 Have a feature request or improvement idea? Reach out at [email protected] — we’d love to hear from you!