Skip to main content
← Back to Table of Contents

Shared location settings

Address search shares its provider and authenticated endpoints with MapPickerField. See shared map configuration for routing, authentication and proxy settings.

Summary

Mapbox-powered address search without a map — combobox autocomplete with structured or string storage. Shares geocoding logic with MapPickerField but omits coordinates by default. On phones and tablets, suggestions open as a bottom sheet with an in-sheet search field (same overlay stack as SelectField) instead of a desktop dropdown. Requires Mapbox token in config('filament-flex-fields.mapbox.access_token') or per-field mapboxToken(). The default server proxy shares its authenticated endpoints with Map Picker, without loading a map SDK. See shared endpoint configuration to configure the prefix and authentication guard.

Basic usage

Structured address storage

String storage


State & storage

Canonical keys

The field uses a standard set of keys for internal state: street, city, region, postcode, country, country_name, place_name.

Storage formats


Configuration API

All methods accept Closure unless noted.

searchTypes()

Limit results to specific Mapbox place types:
Supported type strings / enum cases: country, region, postcode, district, place, locality, neighborhood, address, poi.
Note: Mapbox Geocoding v5 treats poi as general points of interest. It does not filter by category (restaurant vs cafe). Category search requires Mapbox Search Box (not wired in this field).

language()

Preferred language for result labels. When null (or omitted), the field falls back to config('filament-flex-fields.mapbox.default_language'), then app()->getLocale().

FlexField / Flex Forms schema config

When building via FlexFieldFormBuilder / Flex Forms Studio, these config keys map onto the fluent API (see also GeocodingSearchScope presets): GeocodingSearchScope enum (Bjanczak\FilamentFlexFields\Enums\GeocodingSearchScope) is the shared preset map used by Address Autocomplete and Map Picker configurators.

Real-world examples

Simple city picker

Full shipping address


Shared search and editable addresses

Both fields support searchLimit() (1–10), searchBounds() (nonwrapping bbox), searchProximity() ([lng,lat]), geocodingEndpoints('/search', '/reverse'), debounce/minimum search length, countries/types/language and existing storage policies. Search is bounded to 256 characters. Direct/proxy cache keys include search scope and limit. countries(null) is unrestricted; countries([]) denies search rather than silently becoming unrestricted. The configured endpoint must be a same-origin path because requests carry session/CSRF information. AddressAutocomplete keeps its existing default storage keys; fields(['lat','lng', ...]) opts into coordinate storage. addressDetails() shows structured detail inputs; editableAddress() enables manual corrections; editableAddressFields() admits only street/city/region/postcode/country. Read-only detail inputs do not modify state. A manual address edit clears the old coordinates and result identity, avoiding a new text address paired with stale coordinates. Required keys must be present in the configured stored field set. Restricted nonempty addresses with country storage must include admitted country metadata; omitting it no longer bypasses validation.

Playground

/admin/flex-fields/address-autocomplete See Playground for setup.

CSS classes (reference)


Performance

Last modified on October 16, 2026