skywalker-labs/location

OmniLocate: Advanced user location detection for Laravel with persistence, caching, and distance utilities.

Fund package maintenance!
ermradulsharma

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

pkg:composer/skywalker-labs/location

v2.0.0 2026-02-15 11:31 UTC

This package is auto-updated.

Last update: 2026-02-15 11:33:09 UTC


README

📍 OmniLocate: The Toolkit-Powered Location Intelligence

Professional GEO-Resolution, Risk Scoring, and Hybrid Verification for Laravel 12+

Latest Version Laravel Version Toolkit Foundation

OmniLocate is an elite geographical intelligence library built on the Skywalker Toolkit Foundation. It provides standardized API responses, multi-driver failover, and advanced security features like Tor blocking and hybrid location verification.

🌍 Why OmniLocate?

  1. Toolkit Foundation: Leveraging skywalker-labs/toolkit for standardized API responses (ApiResponse), enhanced I/O (Command), and prefixed database models.
  2. Multi-Driver Resilience: Automatic failover between 8+ native drivers (MaxMind, IPInfo, IpApi, etc.) to ensure location data is always available.
  3. Hybrid Verification: Combines IP geolocation with real-time GPS coordinates to detect spoofing and VPN usage.
  4. Geo-Fencing & Risk Guard: Built-in middleware to restrict traffic or block high-risk IPs based on customizable scoring.
  5. Analytics Dashboard: A full-featured dashboard for monitoring requests, threats, and geographical trends.

⚡ Performance & Standards

Feature Legacy OmniLocate (v2.0+)
Foundation Custom Skywalker Toolkit
API Format Flat JSON Standardized JSON Wrapper
Lookup Speed 200ms ~40ms (Cached)
Model Support Eloquent Prefixed Models (location_*)
Verification IP only Hybrid (IP + GPS)

🚀 Installation

Install the package via composer:

composer require skywalker-labs/location

Publish the configuration, assets, and migrations:

php artisan vendor:publish --provider="Skywalker\Location\LocationServiceProvider"

Run the migrations for GeoAnalytics:

php artisan migrate

🛠️ Usage

Basic Location Trace

use Skywalker\Location\Facades\Location;

$position = Location::get(); // Auto-detects IP

echo $position->countryName;   // "United States"
echo $position->currencyCode;  // "USD"
echo $position->latitude;      // "40.7128"

Hybrid Verification (GPS + IP)

Perfect for mobile-web apps that need to ensure users are where they say they are.

use Skywalker\Location\Services\HybridVerifier;

$verifier = new HybridVerifier();
$result = $verifier->verify($ip, $latitude, $longitude);

if ($result['is_spoofed']) {
    // Handle spoofing/VPN usage
}

Standardized API Responses

All package controllers return standardized responses via the Toolkit's ApiResponse trait:

{
  "status": "success",
  "message": "Location verification completed",
  "data": {
    "verified": true,
    "is_spoofed": false,
    "distance_km": 12.5,
    "ip_location": { ... },
    "gps_location": { ... }
  }
}

🛡️ Middleware Power

OmniLocate ships with powerful security middleware:

  • TorBlocker: Blocks requests originating from Tor exit nodes.
  • GeoRestriction: Restricts access to specific countries or continents.
  • GeoRiskGuard: Blocks IPs with risk scores above your threshold.
  • BotVerifier: Verifies legitimate crawlers (Google, Bing) to avoid accidental blocking.
// routes/web.php
Route::middleware(['location.tor', 'location.risk:70'])->group(function () {
    Route::get('/checkout', [CheckoutController::class, 'index']);
});

📊 GeoAnalytics Dashboard

Enable the dashboard in config/location.php to monitor your traffic in real-time.

  • Path: /omni-locate/dashboard
  • Features: Total requests, blocked threats, top countries, and live log stream.

🔧 Drivers Supported

OmniLocate supports a wide array of drivers out of the box:

  • IpApi (Default)
  • IpInfo
  • IpData
  • MaxMind (Database & Web Service)
  • GeoPlugin
  • HttpHeader (For Cloudflare/Varnish upstream headers)

Created & Maintained by Skywalker-Labs Team. Distributed under the MIT License.