Filament package for address and location handling with smart lookup and dynamic selects
dominasys/filament-location is a Laravel package for filament package for address and location handling with smart lookup and dynamic selects.
It currently has 0 GitHub stars and 296 downloads on Packagist (latest version v5.13.0).
Install it with composer require dominasys/filament-location.
Discover more Laravel packages by dominasys
or browse all Laravel packages to compare alternatives.
Last updated
filament-location provides reusable Filament components for address forms, postal code lookup, and country-aware location fields.
PostalCode lookup with standardized resultsstate, city, neighborhood, street, house number, and complementstate and cityen and pt_BRInstall the package with Composer:
composer require dominasys/filament-location
Use the provided components in your Filament form schemas:
use Dominasys\FilamentLocation\Forms\Components\Address\City;
use Dominasys\FilamentLocation\Forms\Components\Address\Complement;
use Dominasys\FilamentLocation\Forms\Components\Address\HouseNumber;
use Dominasys\FilamentLocation\Forms\Components\Address\Neighborhood;
use Dominasys\FilamentLocation\Forms\Components\Address\State;
use Dominasys\FilamentLocation\Forms\Components\Address\Street;
use Dominasys\FilamentLocation\Forms\Components\PostalCode;
PostalCode::make('postal_code');
State::make('state');
City::make('city');
Neighborhood::make('neighborhood');
Street::make('street');
HouseNumber::make('house_number');
Complement::make('complement');
Enable Google only in applications that need it. Use a browser key restricted by domain for Maps JavaScript, Places API (New), and client-side Geocoding. Keep a separate server key restricted by IP for server-side reverse geocoding:
For the complete Google Cloud, credentials, security, validation, and troubleshooting setup, see the Google Maps integration guide.
FILAMENT_LOCATION_GOOGLE_ENABLED=true
FILAMENT_LOCATION_GOOGLE_BROWSER_KEY=
FILAMENT_LOCATION_GOOGLE_SERVER_KEY=
FILAMENT_LOCATION_GOOGLE_EMBED_KEY=
FILAMENT_LOCATION_GOOGLE_MAP_ID=
FILAMENT_LOCATION_GOOGLE_REVERSE_GEOCODING_CACHE_TTL=86400
The picker loads its Alpine component on demand and only initializes Google Maps after the field is actually visible:
use Dominasys\FilamentLocation\Forms\Components\GooglePlacePicker;
GooglePlacePicker::make('google_place')
->bindVenueNameField('venue_name')
->bindAddressField('formatted_address')
->bindPostalCodeField('postal_code')
->bindStateField('state')
->bindStateCodeField('state_code')
->bindCityField('city')
->bindCityCodeField('city_code')
->bindLatitudeField('latitude')
->bindLongitudeField('longitude')
->bindPlaceIdField('place_id')
->bindSourceField('location_source')
->bindPrecisionField('location_precision')
->placeSource('google')
->pinSource('google_pin')
->placePrecision('rooftop')
->pinPrecision('user_selected');
Clicking a point without a place or finishing a pin drag performs one client-side reverse-geocoding request and synchronizes the address and coordinates. No geocoding runs during hydration. Server-side flows may use ReverseGeocodingServiceContract::reverse() explicitly.
If you want the city select to store the label while also syncing a hidden code field:
City::make('city')
->bindCityCodeField('city_ibge')
->bindCityLabelField('city')
->useLabelAsValue();
Today the package ships with support for Brazil (BR).
The address dataset is country-based, so additional countries can be added without changing the public component API.
To add support for another country, follow the same pattern used for Brazil:
The package is intentionally structured so the UI components keep the same API even when the underlying data source changes.
Run the full local quality gate with:
composer check
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you want to add support for a new country, keep the implementation country-driven and avoid adding Brazil-specific assumptions to shared code.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.