enmaboya / place-input
A Laravel Nova field.
1.0
2021-09-07 12:31 UTC
Requires
- php: >=7.1.0
README
This package provides a customisable field with a city/country/place of interest search.
Powered by Nominatim.
Installation
composer require enmaboya/place-input
Basic usage
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')
Available settings
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->onlyCities()
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->onlyCountries()
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->onlyStates()
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->onlyCounties()
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->byPostalCode()
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->continents(['NA', 'SA'])
Available list of continents:
- AF - Africa
- AS - Asia
- EU - Europe
- NA - North America
- OC - Oceania
- SA - South America
use Enmaboya\PlaceInput\PlaceInput; PlaceInput::make('some_place')->countries(['RU', 'US', 'CN', 'JP'])
-
dependOnCountrySelect - If you use the County Select field, the search will be restricted to the country selected in County Select.
use Enmaboya\CountrySelect\CountrySelect; use Enmaboya\PlaceInput\PlaceInput; CountrySelect::make('Country', 'county_code'); PlaceInput::make('some_place')->dependOnCountrySelect('county_code'),
License
The MIT License (MIT). Please see License File for more information.