el-schneider / statamic-simple-address
A simple address automcomplete for Statamic
Fund package maintenance!
Buy Me A Coffee
Installs: 34
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:statamic-addon
pkg:composer/el-schneider/statamic-simple-address
Requires
- php: ^8.3
- geocoder-php/cache-provider: ^4.0
- geocoder-php/nominatim-provider: ^5.8
- guzzlehttp/guzzle: ^7.10
- statamic/cms: ^5.0
Requires (Dev)
- laravel/pint: ^1.22
- orchestra/testbench: ^10.0
- pestphp/pest: *
This package is auto-updated.
Last update: 2025-12-05 14:49:15 UTC
README
Disclaimer: Statamic Simple Address recently underwent a complete rewrite and is now under active development, so features and APIs may change.
Statamic Simple Address
A simple address autocomplete fieldtype for Statamic. Works out of the box with no API keys needed.
Simple by default – flexible when needed.
Features
- Zero-config setup – Uses Nominatim (OpenStreetMap) by default
- Backend routing – Requests go through your backend and are deduped
- Interactive map – Draggable marker with reverse geocoding
- YAML preview – View and verify stored data
- Any geocoder-php provider – Works with 30+ providers from geocoder-php. Pre-configured examples for Nominatim, Google Maps, and Mapbox
Quick Start
Add a Simple Address field to your blueprint.
The field stores a normalized address structure:
label: London, England, United Kingdom lat: 51.5072178 lon: -0.1275862 providedBy: google_maps bounds: south: 51.38494009999999 west: -0.3514683 north: 51.6723432 east: 0.148271 locality: London adminLevels: 1: name: England code: England level: 1 2: name: Greater London code: Greater London level: 2 country: United Kingdom countryCode: GB
Note: The default Nominatim setup is ideal for local development. The public Nominatim server has a strict 1 req/sec limit and forbids autocomplete on the client side. For production, most users switch to Geoapify, Google, or Mapbox – all offer free tiers, but usage limits and terms vary.
Configuration
composer require el-schneider/statamic-simple-address
Works immediately with Nominatim as the default provider.
Using a Different Provider
To switch from Nominatim to another provider:
- Install the provider package
- Publish the config and add/uncomment the provider entry
- Set the required environment variables
php artisan vendor:publish --tag=simple-address-config
Google Maps
composer require geocoder-php/google-maps-provider
SIMPLE_ADDRESS_PROVIDER=google GOOGLE_GEOCODE_API_KEY=your-api-key
Mapbox
composer require geocoder-php/mapbox-provider
SIMPLE_ADDRESS_PROVIDER=mapbox MAPBOX_API_KEY=your-token
The published config includes commented examples for Google and Mapbox. For other providers, add an entry to config/simple-address.php:
'my_provider' => [ 'class' => \Geocoder\Provider\MyProvider\MyProvider::class, 'args' => [env('MY_PROVIDER_API_KEY')], ],
See Geocoder PHP docs for available providers and their constructor arguments. Thanks to geocoder-php for making multi-provider geocoding easy.
