Download the PHP package topukhan/geokit without Composer
On this page you can find all versions of the php package topukhan/geokit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package geokit
Geokit - Laravel Geocoding Toolkit
A clean and extensible geocoding toolkit for Laravel that supports multiple providers with automatic fallback handling.
Features
- 🌍 Multiple Providers: Geoapify (premium) and Nominatim (free) support
- 🔄 Smart Fallback: Automatically falls back to next provider if one fails
- 🛡️ Quota Protection: Detects API quota issues and handles them gracefully
- 🎯 Consistent Results: Unified response format across all providers
- ⚡ Laravel Integration: Facade and Service injection support
- 🔧 Configurable: Easy configuration and extensible architecture
Installation
Install the package via Composer:
Publish the configuration file:
Configuration
Environment Variables
Add these variables to your .env
file:
Config File
The config/geokit.php
file allows you to customize:
- Provider order and selection
- API keys
- Request timeouts
- Result limits
Usage
Using the Facade
Using Service Injection
Response Format
All searches return a GeocodeResponse
object with this structure:
Each result in the results
array is a GeocodeResult
object:
Example Response
Provider Details
Geoapify
- Type: Premium (requires API key)
- Quota: Varies by plan
- Accuracy: High
- Coverage: Global
Nominatim
- Type: Free (no API key required)
- Quota: Rate limited
- Accuracy: Good
- Coverage: Global (OpenStreetMap data)
Error Handling
The package handles various error scenarios automatically:
- Invalid API Keys: Automatically falls back to next provider
- Quota Exceeded: Detects quota issues and skips provider
- Network Timeouts: Respects configured timeout limits
- Rate Limits: Handles rate limiting gracefully
Extending with New Providers
To add a new geocoding provider:
- Create a new class implementing
GeocodingDriverInterface
- Add it to the service provider's provider mapping
- Update the configuration file
Example:
Requirements
- PHP 8.1+
- Laravel 10.0+
License
This package is open-sourced software licensed under the MIT license.
All versions of geokit with dependencies
illuminate/support Version ^10.0|^11.0
illuminate/http Version ^10.0|^11.0
illuminate/config Version ^10.0|^11.0