1010> If you still use** Laravel 4** , please check out the` 0.4.x ` branch
1111[ here] ( https://github.com/geocoder-php/GeocoderLaravel/tree/0.4.x ) .
1212
13- ** Version2 .0.0 is a backwards-compatibility-breaking update. Please review
13+ ** Version4 .0.0 is a backwards-compatibility-breaking update. Please review
1414 this documentation, especially the_ Usage_ section before installing.**
1515
1616This package allows you to use[ ** Geocoder** ] ( http://geocoder-php.org/Geocoder/ )
@@ -26,18 +26,18 @@ This package allows you to use [**Geocoder**](http://geocoder-php.org/Geocoder/)
2626composer require toin0u/geocoder-laravel
2727```
2828
29- 2 . Find the` providers ` array key in` config/app.php ` and register the** Geocoder Service Provider** :
29+ 2 . ** If you are running Laravel 5.5, skip this step. ** Find the` providers ` array key in` config/app.php ` and register the** Geocoder Service Provider** :
3030``` php
3131// 'providers' => [
3232 Geocoder\Laravel\Providers\GeocoderService::class,
3333// ];
3434```
3535
3636##Upgrading
37- ###1.x to2 .x
37+ ###1.x to4 .x
3838Update your composer.json file:
3939``` json
40- "toin0u/geocoder-laravel" :" ^2 .0" ,
40+ "toin0u/geocoder-laravel" :" ^4 .0" ,
4141```
4242
4343The one change to keep in mind here is that the results returned from
@@ -108,19 +108,22 @@ Further, a special note on the GoogleMaps provider: if you are using an API key,
108108See the [Geocoder documentation](http://geocoder-php.org/Geocoder/) for a list
109109of available adapters and providers.
110110
111- ### Default Settings
112- If you are upgrading and do not update your config file with the `cache-duraction`
113- variable, cache will by default be disabled (it will have a `0` cache duration).
114- The default cache duration provided by the config file is `999999999` minutes,
115- essentially forever.
116-
117- By default, the configuration specifies a Chain Provider as the first provider,
118- containing GoogleMaps and FreeGeoIp providers. The first to return a result
119- will be returned. After the Chain Provider, we have added the BingMaps provider
120- for use in specific situations (providers contained in the Chain provider will
121- be run by default, providers not in the Chain provider need to be called
122- explicitly). The second GoogleMaps Provider outside of the Chain Provider is
123- there just to illustrate this point (and is used by the PHPUnit tests).
111+ ### Configuration
112+ #### Providers
113+ If you are upgrading and have previously published the geocoder config file, you
114+ need to add the `cache-duration` variable, otherwise cache will be disabled
115+ (it will default to a `0` cache duration). The default cache duration provided
116+ by the config file is `999999999` minutes, essentially forever.
117+
118+ By default, the configuration specifies a Chain provider, containing the
119+ GoogleMaps provider for addresses as well as reverse lookups with lat/long,
120+ and the GeoIP provider for IP addresses. The first to return a result
121+ will be returned, and subsequent providers will not be executed. The default
122+ config file is kept lean with only those two providers.
123+
124+ However, you are free to add or remove providers as needed, both inside the
125+ Chain provider, as well as along-side it. The following is an example config
126+ with additional providers we use for testing:
124127```php
125128use Http\Client\Curl\Client;
126129use Geocoder\Provider\BingMaps\BingMaps;
@@ -129,7 +132,7 @@ use Geocoder\Provider\FreeGeoIp\FreeGeoIp;
129132use Geocoder\Provider\GoogleMaps\GoogleMaps;
130133
131134return [
132- 'cache-duraction ' => 999999999,
135+ 'cache-duration ' => 999999999,
133136'providers' => [
134137Chain::class => [
135138GoogleMaps::class => [
@@ -151,6 +154,13 @@ return [
151154];
152155```
153156
157+ ####Adapters
158+ By default we provide a CURL adapter to get you running out of the box.
159+ However, if you have already installed Guzzle or any other PSR-7-compatible
160+ HTTP adapter, you are encouraged to replace the CURL adapter with it. Please
161+ see the[ Geocoder Documentation] ( https://github.com/geocoder-php/Geocoder ) for
162+ specific implementation details.
163+
154164###Customization
155165If you would like to make changes to the default configuration, publish and
156166 edit the configuration file:
@@ -168,6 +178,11 @@ The service provider initializes the `geocoder` service, accessible via the
168178app('geocoder')->geocode('Los Angeles, CA')->get();
169179```
170180
181+ ####Get IP Address Information
182+ ``` php
183+ app('geocoder')->geocode('8.8.8.8')->get();
184+ ```
185+
171186####Reverse-Geocoding
172187``` php
173188app('geocoder')->reverse(43.882587,-103.454067)->get();
@@ -193,4 +208,4 @@ Please note that this project is released with a
193208##License
194209GeocoderLaravel is released under the MIT License. See the bundled
195210[ LICENSE] ( https://github.com/geocoder-php/GeocoderLaravel/blob/master/LICENSE )
196- file for details.
211+ file for details.