PHP code example of dominasys / filament-location

1. Go to this page and download the library: Download dominasys/filament-location library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dominasys / filament-location example snippets


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');

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');

City::make('city')
    ->bindCityCodeField('city_ibge')
    ->bindCityLabelField('city')
    ->useLabelAsValue();