@@ -69,35 +69,90 @@ By default, the configuration specifies a Chain provider, containing the
69
69
config file is kept lean with only those two providers.
70
70
71
71
However, you are free to add or remove providers as needed, both inside the
72
- Chain provider, as well as along-side it. The following is an example config
73
- with additional providers we use for testing :
72
+ Chain provider, as well as along-side it. The following is the default
73
+ configuration provided by the package :
74
74
``` php
75
- use Http\Client\Curl\Client;
76
- use Geocoder\Provider\BingMaps\BingMaps;
77
75
use Geocoder\Provider\Chain\Chain;
78
- use Geocoder\Provider\FreeGeoIp\FreeGeoIp ;
76
+ use Geocoder\Provider\GeoPlugin\GeoPlugin ;
79
77
use Geocoder\Provider\GoogleMaps\GoogleMaps;
78
+ use Http\Client\Curl\Client;
80
79
81
80
return [
82
- 'cache-duration' => 999999999,
81
+
82
+ /*
83
+ |--------------------------------------------------------------------------
84
+ | Cache Duration
85
+ |--------------------------------------------------------------------------
86
+ |
87
+ | Specify the cache duration in seconds. The default approximates a forever
88
+ | cache, but there are certain issues with Laravel's forever caching
89
+ | methods that prevent us from using them in this project.
90
+ |
91
+ | Default: 9999999 (integer)
92
+ |
93
+ */
94
+ 'cache-duration' => 9999999,
95
+
96
+ /*
97
+ |--------------------------------------------------------------------------
98
+ | Providers
99
+ |--------------------------------------------------------------------------
100
+ |
101
+ | Here you may specify any number of providers that should be used to
102
+ | perform geocaching operations. The `chain` provider is special,
103
+ | in that it can contain multiple providers that will be run in
104
+ | the sequence listed, should the previous provider fail. By
105
+ | default the first provider listed will be used, but you
106
+ | can explicitly call subsequently listed providers by
107
+ | alias: `app('geocoder')->using('google_maps')`.
108
+ |
109
+ | Please consult the official Geocoder documentation for more info.
110
+ | https://github.com/geocoder-php/Geocoder#providers
111
+ |
112
+ */
83
113
'providers' => [
84
114
Chain::class => [
85
115
GoogleMaps::class => [
86
- ' en-US',
116
+ env('GOOGLE_MAPS_LOCALE', ' en-US') ,
87
117
env('GOOGLE_MAPS_API_KEY'),
88
118
],
89
- FreeGeoIp::class => [],
90
- ],
91
- BingMaps::class => [
92
- 'en-US',
93
- env('BING_MAPS_API_KEY'),
94
- ],
95
- GoogleMaps::class => [
96
- 'us',
97
- env('GOOGLE_MAPS_API_KEY'),
119
+ GeoPlugin::class => [],
98
120
],
99
121
],
122
+
123
+ /*
124
+ |--------------------------------------------------------------------------
125
+ | Adapter
126
+ |--------------------------------------------------------------------------
127
+ |
128
+ | You can specify which PSR-7-compliant HTTP adapter you would like to use.
129
+ | There are multiple options at your disposal: CURL, Guzzle, and others.
130
+ |
131
+ | Please consult the official Geocoder documentation for more info.
132
+ | https://github.com/geocoder-php/Geocoder#usage
133
+ |
134
+ | Default: Client::class (FQCN for CURL adapter)
135
+ |
136
+ */
100
137
'adapter' => Client::class,
138
+
139
+ /*
140
+ |--------------------------------------------------------------------------
141
+ | Reader
142
+ |--------------------------------------------------------------------------
143
+ |
144
+ | You can specify a reader for specific providers, like GeoIp2, which
145
+ | connect to a local file-database. The reader should be set to an
146
+ | instance of the required reader class.
147
+ |
148
+ | Please consult the official Geocoder documentation for more info.
149
+ | https://github.com/geocoder-php/geoip2-provider
150
+ |
151
+ | Default: null
152
+ |
153
+ */
154
+ 'reader' => null,
155
+
101
156
];
102
157
```
103
158
@@ -216,7 +271,7 @@ If you are upgrading from a pre-1.x version of this package, please keep the
216
271
- Clear cache: `php artisan cache:clear`.
217
272
- If you are still experiencing difficulties, please please open an issue on GitHub:
218
273
https://github.com/geocoder-php/GeocoderLaravel/issues.
219
-
274
+
220
275
## Changelog
221
276
https://github.com/geocoder-php/GeocoderLaravel/blob/master/CHANGELOG.md
222
277
0 commit comments