PHP code example of mauricewijnia / nova-maps-address

1. Go to this page and download the library: Download mauricewijnia/nova-maps-address 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/ */

    

mauricewijnia / nova-maps-address example snippets


use Mauricewijnia\NovaMapsAddress\MapsAddress;
...
public function fields(Request $request) {
    return [
        ...
        MapsAddress::make(__('Address'), 'address'),
        ...
    ];
}


protected $casts = [
    'address' => 'array'
]


MapsAddress::make(__('Address'), 'address')
    ->zoom(5)
    ->center(['lat' => 55.5, 'lng' => 5.5])
    ->types(['address' ,'establishment']);

MapsAddress::make(__('shop_admin.places.address'), 'address')->types([])
                    ->scriptUrlParams(['region' => 'jp', 'language' => 'ja'])
                    ->autoCompleteOptions(['componentRestrictions' => ['country' => ['jp']]])
                    ->mapOptions(['componentRestrictions' => ['country' => ['jp']]])