Skip to content

Commit af5f193

Browse files
committed
Updated readme with initial upgrade instructions
Fixes #65
1 parent b338ce8 commit af5f193

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,35 @@ This package allows you to use [**Geocoder**](http://geocoder-php.org/Geocoder/)
2929
// ];
3030
```
3131

32+
## Upgrading
33+
If you are upgrading from a pre-1.x version of this package, please keep the
34+
following things in mind:
35+
36+
1. Update your composer.json file as follows:
37+
```json
38+
"toin0u/geocoder-laravel": "^1.0",
39+
```
40+
41+
2. Remove your `config/geocoder.php` configuration file. (If you need to
42+
customize it, follow the configuration instructions below.)
43+
3. Update the service provider entry in your `config/app.php` to read:
44+
```php
45+
Geocoder\Laravel\Providers\GeocoderService::class,
46+
```
47+
Also make sure you remove any Geocoder alias in the aliases section of this
48+
file. (This package auto-registers the aliases.)
49+
3. If you are using the facade in your code, update the `use` statements to the
50+
following:
51+
```php
52+
use use Geocoder\Laravel\Facades\Geocoder;
53+
```
54+
55+
Alternatively you can replace the facades `Geocoder::` (and remove the corresponding `use`
56+
statements) with `app('geocoder')->`.
57+
4. Update your query statements to use `->get()` (to retrieve a collection of
58+
GeoCoder objects) or `->all()` (to retrieve an array of arrays), then iterate
59+
to process each result.
60+
3261
## Configuration
3362
Pay special attention to the language and region values if you are using them.
3463
For example, the GoogleMaps provider uses TLDs for region values, and the

0 commit comments

Comments
 (0)