File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ Find the `aliases` key in `app/config/app.php` and register the **Geocoder Facad
6464Configuration
6565-------------
6666
67+ Publish the configuration
68+
69+ $ php artisan config:publish toin0u\geocoder-laravel
70+
6771The service provider creates the following services:
6872
6973 * `geocoder`: the Geocoder instance.
Original file line number Diff line number Diff line change 1212namespace Toin0u \Geocoder ;
1313
1414use Geocoder \Geocoder ;
15- use Geocoder \Provider \FreeGeoIpProvider ;
16- use Geocoder \HttpAdapter \CurlHttpAdapter ;
1715use Illuminate \Support \ServiceProvider ;
1816
1917/**
@@ -36,7 +34,7 @@ class GeocoderServiceProvider extends ServiceProvider
3634 * @return void
3735 */
3836 public function boot () {
39- $ this ->package ('willdurand /geocoder ' );
37+ $ this ->package ('toin0u /geocoder-laravel ' );
4038 }
4139
4240 /**
@@ -49,11 +47,15 @@ public function register()
4947 $ app = $ this ->app ;
5048
5149 $ this ->app ['geocoder.adapter ' ] = $ this ->app ->share (function () {
52- return new CurlHttpAdapter ;
50+ $ adapter = \Config::get ('geocoder-laravel::adapter ' );
51+ $ class = 'Geocoder\HttpAdapter \\' . $ adapter ;
52+ return new $ class ;
5353 });
5454
5555 $ this ->app ['geocoder.provider ' ] = $ this ->app ->share (function ($ app ) {
56- return new FreeGeoIpProvider ($ app ['geocoder.adapter ' ]);
56+ $ provider = \Config::get ('geocoder-laravel::provider ' );
57+ $ class = '\Geocoder\Provider \\' . $ provider ;
58+ return new $ class ($ app ['geocoder.adapter ' ]);
5759 });
5860
5961 $ this ->app ['geocoder ' ] = $ this ->app ->share (function ($ app ) {
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return array (
4+ 'provider ' => 'FreeGeoIpProvider ' ,
5+ 'adapter ' => 'CurlHttpAdapter '
6+ );
You can’t perform that action at this time.
0 commit comments