Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Tomtom Provider

Tomtom Provider Laravel Package

geocoder-php/tomtom-provider

TomTom provider for the Geocoder PHP library. Adds forward and reverse geocoding via TomTom APIs, returning standardized Geocoder results for addresses, coordinates, and place lookups. Useful for Laravel/PHP apps needing TomTom-backed location search.

View on GitHub
Deep Wiki
Context7

[READ ONLY] Provider for TomTom

Frequently asked questions about Tomtom Provider
How do I install the TomTom provider for Geocoder in a Laravel project?
Run `composer require geocoder-php/tomtom-provider` to install the package. Then register the provider in your Laravel Service Provider by binding it to the Geocoder container singleton, using your TomTom API key from `.env`. Example: `$geocoder->registerProvider(new TomTomProvider(env('TOMTOM_API_KEY')))`.
What Laravel versions does this package support?
The package supports Laravel 5.5+ and PHP 7.4+. Verify compatibility by checking the `composer.json` constraints in the package repository. If using Laravel 10+, ensure no breaking changes exist with the Geocoder library’s latest version.
Can I use this provider for reverse geocoding (coordinates to addresses)?
Yes, the TomTom provider supports both forward (address to coordinates) and reverse geocoding. Use `$geocoder->reverse($latitude, $longitude)` to convert coordinates to addresses, returning standardized Geocoder results.
How do I handle TomTom API rate limits in production?
TomTom’s free tier has strict limits (e.g., 25,000 requests/month). Implement caching (e.g., Redis) with a TTL of 1–24 hours for static data, and use Laravel Queues to batch or delay non-critical geocoding requests. Monitor API responses for HTTP 429 errors.
Is there a fallback mechanism if TomTom’s API fails?
The package doesn’t include built-in fallback logic, but you can manually register multiple providers (e.g., TomTom + OpenStreetMap) and handle failures via try-catch blocks. Alternatively, extend the Geocoder instance to implement a priority chain for providers.
How do I configure the TomTom provider in Laravel’s `.env` file?
Add your TomTom API key to `.env` as `TOMTOM_API_KEY=your_key_here`. The provider also supports customizing the API host (e.g., `TOMTOM_HOST=api.tomtom.com`). Configure these values in your Service Provider or directly in the provider initialization.
Can I mock the TomTom provider for unit testing in Laravel?
Yes, use Laravel’s Mockery or Vesper to mock the `TomTomProvider` class. Override its `geocode()` or `reverse()` methods in your tests to return mock responses. Example: `$mockProvider->shouldReceive('geocode')->andReturn($mockResult)`.
What are the alternatives to this package for Laravel geocoding?
Alternatives include `geocoder-php/mapbox-provider` (Mapbox API), `geocoder-php/google-maps-provider` (Google Maps), or `geocoder-php/openstreetmap-provider` (free, open-source). Compare pricing, accuracy, and rate limits before choosing.
How do I store geocoded results in a Laravel database?
Use Eloquent models to store geocoded data (e.g., `latitude`, `longitude`, `formatted_address`). For searchability, add a `scout` trait or use Laravel Scout with Algolia. Cache frequent queries in Redis to reduce API calls.
Is this package actively maintained? How can I check?
Check the GitHub repository for recent commits (last 6–12 months) and open issues. The package has low stars, so verify compatibility with the latest Geocoder library and TomTom API changes. Monitor for updates or consider forking if maintenance is critical.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor