geocoder-php / GeocoderLaravel

Geocoder service provider for Laravel
http://geocoder-php.org/GeocoderLaravel/
MIT License
692 stars 102 forks source link

No provider could reverse coordinates (Homestead/WIndows 10) #82

Closed alexc-hollywood closed 7 years ago

alexc-hollywood commented 7 years ago

General Information

GeocoderLaravel Version: 1.0.5 Laravel Version: 5.4 PHP Version: 7.1 Operating System and Version: Ubuntu (Homestead) on Windows 10 (VirtualBox)

Issue Description

Getting this error again on Homestead.

Steps to Replicate

vagrant@homestead:~/Code/Acme$ php artisan tinker Psy Shell v0.8.6 (PHP 7.1.3-3+deb.sury.org~xenial+1 — cli) by Justin Hileman

app('geocoder')->reverse(43.882587,-103.454067)->get(); Geocoder\Exception\ChainNoResult with message 'No provider could reverse coordinates: 43.882587, -103.454067.'

Stack Trace

Stack trace:

0 /home/vagrant/Code/Acme/vendor/willdurand/geocoder/src/Geocoder/ProviderAggregator.php(74): Geocoder\Provider\Chain->reverse(43.653226, -79.3831843)

1 /home/vagrant/Code/Acme/vendor/toin0u/geocoder-laravel/src/ProviderAndDumperAggregator.php(97): Geocoder\ProviderAggregator->reverse(43.653226, -79.3831843)

2 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Geocoder\Laravel\ProviderAndDumperAggregator->reverse(43.653226, -79.3831843)

3 /home/vagrant/Code/Acme/app/Services/Search/ProximitySearch.php(129): Illuminate\Support\Facades\Facade::__callStatic('reverse', Array)

4 /home/vagrant/Code/Acme/app/Services/Search/ProximitySearch.php(294): Acme\Services\Search\ProximitySearch->reverse_geocode(43.653226, -79.3831843)

5 /home/vagrant/Code/Acme/app/Services/Search/ProximitySearch.php(330): Acme\Services\Search\ProximitySearch->resolve_url_params()

6 /home/vagrant/Code/Acme/app/Http/Controllers/Front/SearchController.php(115): Acme\Services\Search\ProximitySearch->build()

7 [internal function]: Acme\Http\Controllers\Front\SearchController->show_results_screen(Object(Illuminate\Http\Request), 'personal-traine...', 'all', 'toronto-on-cana...', '43.653226,-79.3...')

8 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(55): call_user_func_array(Array, Array)

9 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction('show_results_sc...', Array)

10 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Acme\Http\Controllers\Front\SearchController), 'show_results_sc...')

11 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Route.php(160): Illuminate\Routing\Route->runController()

12 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Router.php(574): Illuminate\Routing\Route->run()

13 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

14 /home/vagrant/Code/Acme/app/Http/Middleware/GetLangSetLocale.php(68): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

15 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Acme\Http\Middleware\GetLangSetLocale->handle(Object(Illuminate\Http\Request), Object(Closure))

16 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

17 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

18 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))

19 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

20 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

21 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))

22 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

23 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

24 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))

25 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

26 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

27 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))

28 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

29 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

30 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))

31 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

32 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

33 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Router.php(576): Illuminate\Pipeline\Pipeline->then(Object(Closure))

34 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Router.php(535): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))

35 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Router.php(513): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))

36 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(174): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))

37 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request))

38 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

39 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))

40 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

41 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

42 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))

43 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request))

44 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request))

45 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))

46 /home/vagrant/Code/Acme/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))

47 /home/vagrant/Code/Acme/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

48 {main}

mikebronner commented 7 years ago

Thanks @azcoppen for reporting this, I will test first thing tomorrow.

imperiumzigna commented 7 years ago

I'm with the same issue

image

mikebronner commented 7 years ago

Looking into it now.

mikebronner commented 7 years ago

@azcoppen Running your command $result = app('geocoder')->reverse(43.882587, -103.454067)->get(); I get the following result:

Geocoder\Model\AddressCollection {#673
  -addresses: array:5 [
    0 => Geocoder\Model\Address {#641
      -coordinates: Geocoder\Model\Coordinates {#642
        -latitude: 43.882753
        -longitude: -103.453278
      }
      -bounds: Geocoder\Model\Bounds {#643
        -south: 43.882753
        -west: -103.453278
        -north: 43.882753
        -east: -103.453278
      }
      -streetNumber: "13024"
      -streetName: "South Dakota 244"
      -subLocality: null
      -locality: "Keystone"
      -postalCode: "57751"
      -adminLevels: Geocoder\Model\AdminLevelCollection {#644
        -adminLevels: array:3 [
          1 => Geocoder\Model\AdminLevel {#640
            -level: 1
            -name: "South Dakota"
            -code: "SD"
          }
          2 => Geocoder\Model\AdminLevel {#639
            -level: 2
            -name: "Pennington County"
            -code: "Pennington County"
          }
          3 => Geocoder\Model\AdminLevel {#638
            -level: 3
            -name: "Mount Rushmore UT"
            -code: "Mount Rushmore UT"
          }
        ]
      }
      -country: Geocoder\Model\Country {#645
        -name: "United States"
        -code: "US"
      }
      -timezone: null
    }
    1 => Geocoder\Model\Address {#647
      -coordinates: Geocoder\Model\Coordinates {#648
        -latitude: 43.8825124
        -longitude: -103.4742993
      }
      -bounds: Geocoder\Model\Bounds {#649
        -south: 43.8241249
        -west: -103.584588
        -north: 43.9301861
        -east: -103.2996849
      }
      -streetNumber: null
      -streetName: null
      -subLocality: null
      -locality: "Keystone"
      -postalCode: "57751"
      -adminLevels: Geocoder\Model\AdminLevelCollection {#650
        -adminLevels: array:1 [
          1 => Geocoder\Model\AdminLevel {#646
            -level: 1
            -name: "South Dakota"
            -code: "SD"
          }
        ]
      }
      -country: Geocoder\Model\Country {#651
        -name: "United States"
        -code: "US"
      }
      -timezone: null
    }
    2 => Geocoder\Model\Address {#655
      -coordinates: Geocoder\Model\Coordinates {#656
        -latitude: 43.9492343
        -longitude: -103.3684019
      }
      -bounds: Geocoder\Model\Bounds {#657
        -south: 43.855816
        -west: -103.5860709
        -north: 44.1408759
        -east: -103.186155
      }
      -streetNumber: null
      -streetName: null
      -subLocality: null
      -locality: null
      -postalCode: null
      -adminLevels: Geocoder\Model\AdminLevelCollection {#658
        -adminLevels: array:3 [
          1 => Geocoder\Model\AdminLevel {#654
            -level: 1
            -name: "South Dakota"
            -code: "SD"
          }
          2 => Geocoder\Model\AdminLevel {#653
            -level: 2
            -name: "Pennington County"
            -code: "Pennington County"
          }
          3 => Geocoder\Model\AdminLevel {#652
            -level: 3
            -name: "Mount Rushmore UT"
            -code: "Mount Rushmore UT"
          }
        ]
      }
      -country: Geocoder\Model\Country {#659
        -name: "United States"
        -code: "US"
      }
      -timezone: null
    }
    3 => Geocoder\Model\Address {#662
      -coordinates: Geocoder\Model\Coordinates {#663
        -latitude: 43.8901111
        -longitude: -102.2547919
      }
      -bounds: Geocoder\Model\Bounds {#664
        -south: 43.685119
        -west: -104.055487
        -north: 44.510926
        -east: -102.000776
      }
      -streetNumber: null
      -streetName: null
      -subLocality: null
      -locality: null
      -postalCode: null
      -adminLevels: Geocoder\Model\AdminLevelCollection {#665
        -adminLevels: array:2 [
          1 => Geocoder\Model\AdminLevel {#661
            -level: 1
            -name: "South Dakota"
            -code: "SD"
          }
          2 => Geocoder\Model\AdminLevel {#660
            -level: 2
            -name: "Pennington County"
            -code: "Pennington County"
          }
        ]
      }
      -country: Geocoder\Model\Country {#666
        -name: "United States"
        -code: "US"
      }
      -timezone: null
    }
    4 => Geocoder\Model\Address {#668
      -coordinates: Geocoder\Model\Coordinates {#669
        -latitude: 44.4415188
        -longitude: -102.6855069
      }
      -bounds: Geocoder\Model\Bounds {#670
        -south: 43.68531
        -west: -104.055488
        -north: 45.039526
        -east: -102.000051
      }
      -streetNumber: null
      -streetName: null
      -subLocality: null
      -locality: null
      -postalCode: null
      -adminLevels: Geocoder\Model\AdminLevelCollection {#671
        -adminLevels: array:1 [
          1 => Geocoder\Model\AdminLevel {#667
            -level: 1
            -name: "South Dakota"
            -code: "SD"
          }
        ]
      }
      -country: Geocoder\Model\Country {#672
        -name: "United States"
        -code: "US"
      }
      -timezone: null
    }
  ]
}
mikebronner commented 7 years ago

@imperiumzigna, running your command $result = app('geocoder')->reverse(-2.571728, -44.225438)->get(); I get:

Geocoder\Model\AddressCollection {#705
  -addresses: array:5 [
    0 => Geocoder\Model\Address {#671
      -coordinates: Geocoder\Model\Coordinates {#672
        -latitude: -2.5717853
        -longitude: -44.2255647
      }
      -bounds: Geocoder\Model\Bounds {#673
        -south: -2.5717853
        -west: -44.2255647
        -north: -2.5717853
        -east: -44.2255647
      }
      -streetNumber: "366"
      -streetName: "Rua Trinta e Seis"
      -subLocality: "Ipem São Cristóvão"
      -locality: "São Luís"
      -postalCode: "65055"
      -adminLevels: Geocoder\Model\AdminLevelCollection {#674
        -adminLevels: array:2 [
          1 => Geocoder\Model\AdminLevel {#670
            -level: 1
            -name: "Maranhão"
            -code: "MA"
          }
          2 => Geocoder\Model\AdminLevel {#669
            -level: 2
            -name: "São Luís"
            -code: "São Luís"
          }
        ]
      }
      -country: Geocoder\Model\Country {#675
        -name: "Brazil"
        -code: "BR"
      }
      -timezone: null
    }
    1 => Geocoder\Model\Address {#678
      -coordinates: Geocoder\Model\Coordinates {#679
        -latitude: -2.5697256
        -longitude: -44.2186775
      }
      -bounds: Geocoder\Model\Bounds {#680
        -south: -2.5780359
        -west: -44.2270538
        -north: -2.5642063
        -east: -44.2115934
      }
      -streetNumber: null
      -streetName: null
      -subLocality: "Ipem São Cristóvão"
      -locality: "São Luís"
      -postalCode: null
      -adminLevels: Geocoder\Model\AdminLevelCollection {#681
        -adminLevels: array:2 [
          1 => Geocoder\Model\AdminLevel {#677
            -level: 1
            -name: "Maranhão"
            -code: "MA"
          }
          2 => Geocoder\Model\AdminLevel {#676
            -level: 2
            -name: "São Luís"
            -code: "São Luís"
          }
        ]
      }
      -country: Geocoder\Model\Country {#682
        -name: "Brazil"
        -code: "BR"
      }
      -timezone: null
    }
    2 => Geocoder\Model\Address {#686
      -coordinates: Geocoder\Model\Coordinates {#687
        -latitude: -2.5391099
        -longitude: -44.2829046
      }
      -bounds: Geocoder\Model\Bounds {#688
        -south: -2.6456449
        -west: -44.3420105
        -north: -2.4756195
        -east: -44.1742335
      }
      -streetNumber: null
      -streetName: null
      -subLocality: null
      -locality: "São Luís"
      -postalCode: null
      -adminLevels: Geocoder\Model\AdminLevelCollection {#689
        -adminLevels: array:3 [
          1 => Geocoder\Model\AdminLevel {#685
            -level: 1
            -name: "Maranhão"
            -code: "MA"
          }
          2 => Geocoder\Model\AdminLevel {#684
            -level: 2
            -name: "São Luís"
            -code: "São Luís"
          }
          4 => Geocoder\Model\AdminLevel {#683
            -level: 4
            -name: "Vila Maranhão"
            -code: "Vila Maranhão"
          }
        ]
      }
      -country: Geocoder\Model\Country {#690
        -name: "Brazil"
        -code: "BR"
      }
      -timezone: null
    }
    3 => Geocoder\Model\Address {#693
      -coordinates: Geocoder\Model\Coordinates {#694
        -latitude: -2.5720305
        -longitude: -44.225862
      }
      -bounds: Geocoder\Model\Bounds {#695
        -south: null
        -west: null
        -north: null
        -east: null
      }
      -streetNumber: null
      -streetName: null
      -subLocality: "Tirirical"
      -locality: "São Luís"
      -postalCode: "65064-390"
      -adminLevels: Geocoder\Model\AdminLevelCollection {#696
        -adminLevels: array:2 [
          1 => Geocoder\Model\AdminLevel {#692
            -level: 1
            -name: "Maranhão"
            -code: "MA"
          }
          2 => Geocoder\Model\AdminLevel {#691
            -level: 2
            -name: "São Luís"
            -code: "São Luís"
          }
        ]
      }
      -country: Geocoder\Model\Country {#697
        -name: "Brazil"
        -code: "BR"
      }
      -timezone: null
    }
    4 => Geocoder\Model\Address {#700
      -coordinates: Geocoder\Model\Coordinates {#701
        -latitude: -2.5724664
        -longitude: -44.2231919
      }
      -bounds: Geocoder\Model\Bounds {#702
        -south: -2.5754979
        -west: -44.2313142
        -north: -2.5418363
        -east: -44.2194625
      }
      -streetNumber: null
      -streetName: null
      -subLocality: "Tirirical"
      -locality: "São Luís"
      -postalCode: "65055-370"
      -adminLevels: Geocoder\Model\AdminLevelCollection {#703
        -adminLevels: array:2 [
          1 => Geocoder\Model\AdminLevel {#699
            -level: 1
            -name: "Maranhão"
            -code: "MA"
          }
          2 => Geocoder\Model\AdminLevel {#698
            -level: 2
            -name: "São Luís"
            -code: "São Luís"
          }
        ]
      }
      -country: Geocoder\Model\Country {#704
        -name: "Brazil"
        -code: "BR"
      }
      -timezone: null
    }
  ]
}
mikebronner commented 7 years ago

From that I conclude that the config file is probably incorrectly structured. Try removing your published config file and running it again. If it still fails, please share your \config\geocoder.php file here. If it still fails, please make sure that you have the latest version of Homestead installed. If it still fails then, it's probably a "Homestead on Windows" issue. The last way to test is to push it to a staging server and see if it runs there.

imperiumzigna commented 7 years ago

Hi, I've tested your suggestions and still the same issue. Here is my config file `use Ivory\HttpAdapter\CurlHttpAdapter; use Ivory\HttpAdapter\Guzzle6HttpAdapter; use Geocoder\Provider\Chain; use Geocoder\Provider\BingMaps; use Geocoder\Provider\FreeGeoIp; use Geocoder\Provider\GoogleMaps; use Geocoder\Provider\MaxMindBinary;

return [ 'providers' => [ Chain::class => [ BingMaps::class => [ 'pt-BR', env('BING_KEY'), ] ] ], 'adapter' => CurlHttpAdapter::class, ];`

I want to only use Bing reverse geolocation

imperiumzigna commented 7 years ago

Hi again, solve here. The error was on the config file. Follow code that solved for me:

return [ 'providers' => [ Chain::class => [ BingMaps::class => [ env('BING_KEY'), ], GoogleMaps::class => [ 'en', 'us', true, env('GOOGLE_API_KEY'), ], FreeGeoIp::class => [], ], BingMaps::class => [ 'en-US', env('BING_MAPS_API_KEY'), ], GoogleMaps::class => [ 'en', 'us', true, env('GOOGLE_MAPS_API_KEY'), ], ], 'adapter' => CurlHttpAdapter::class, ];

mikebronner commented 7 years ago

Glad to hear you got it running again! 👍

mikebronner commented 7 years ago

@azcoppen Can you confirm that you have it working again as well?

alexc-hollywood commented 7 years ago

@mikebronner Still have it there unfortunately, also had to change the Facade namespace.

Config file:

<?php

/**
 * This file is part of the GeocoderLaravel library.
 *
 * (c) Antoine Corcy <contact@sbin.dk>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

 use Ivory\HttpAdapter\CurlHttpAdapter;
 use Ivory\HttpAdapter\Guzzle6HttpAdapter;
 use Geocoder\Provider\Chain;
 use Geocoder\Provider\BingMaps;
 use Geocoder\Provider\FreeGeoIp;
 use Geocoder\Provider\GoogleMaps;
 use Geocoder\Provider\MaxMindBinary;

 return [
     'providers' => [
         Chain::class => [
             GoogleMaps::class => [
                 'en',
                 'us',
                 true,
                 env('GMAPS_API_KEY'),
             ],
             FreeGeoIp::class  => [],
         ],
         BingMaps::class => [
             'en-US',
             env('BING_MAPS_API_KEY'),
         ],
         GoogleMaps::class => [
             'en',
             'us',
             true,
             env('GMAPS_API_KEY'),
         ],
     ],
     'adapter'  => Guzzle6HttpAdapter::class,
 ];
mikebronner commented 7 years ago

@azcoppen can you explain more about the facade namespace? You shouldn't have to use the facade at all, you can access it though app('geocoder'). Can you show the code where you changed the namespace? Thanks!

alexc-hollywood commented 7 years ago

@mikebronner Old habits die hard! Made the change in config/app.php.

From:

'Geocoder'    => 'Toin0u\Geocoder\Facade\Geocoder',

to

'Geocoder'    => 'Geocoder\Laravel\Facades\Geocoder',
mikebronner commented 7 years ago

@azcoppen have you tried removing you config file entirely (temporarily) to see if it works with the default config? If you are using the latest version, please follow the Upgrade process in the readme.

alexc-hollywood commented 7 years ago

@mikebronner You're in the running for support of the year Mr B. Will do, and report back over the w/e.

mikebronner commented 7 years ago

@azcoppen Haha! Thanks for your patience :) Let me know what you find out :) We'll get this working yet!

mikebronner commented 7 years ago

@azcoppen try the latest 1.1.1 version. Let me know how you are coming along.

alexc-hollywood commented 7 years ago

Have tried 1.1.1 and 2.0, results are below:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install toin0u/geocoder-laravel 2.0.0.x-dev
    - Can only install one of: toin0u/geocoder-laravel[2.0.0-RC1, 1.2.0.x-dev].
    - Can only install one of: toin0u/geocoder-laravel[2.0.0-RC1, 1.2.0.x-dev].
    - Installation request for toin0u/geocoder-laravel ^2.0 -> satisfiable by toin0u/geocoder-laravel[2.0.0-RC1, 2.0.0.x-dev]                                             .
    - Installation request for toin0u/geocoder-laravel (locked at 1.2.0.x-dev, required as ^2.0) -> satisfiable by toin0u/geo                                             coder-laravel[1.2.0.x-dev].

Installation failed, reverting ./composer.json to its original content.
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: toin0u/geocoder-laravel[1.1.1, 1.2.0.x-dev].
    - Can only install one of: toin0u/geocoder-laravel[1.1.1, 1.2.0.x-dev].
    - Installation request for toin0u/geocoder-laravel 1.1.1 -> satisfiable by toin0u/geocoder-laravel[1.1.1].
    - Installation request for toin0u/geocoder-laravel (locked at 1.2.0.x-dev, required as 1.1.1) -> satisfiable by toin0u/geocoder-laravel[1.2.0.x-dev].

Installation failed, reverting ./composer.json to its original content.
mikebronner commented 7 years ago

Can you past your composer.json here?

alexc-hollywood commented 7 years ago

Yep no problem. Currently installing Recaptcha, which seems to clash.

{
    "name": "fhmatch/laravel",
    "description": "FHMatch Laravel 5.4",
    "keywords": ["fhmatch", "laravel"],
    "license": "Commercial",
    "type": "project",
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.6.4",
        "cweagans/composer-patches": "~1.0",
        "microsoft/windowsazure": "^0.4",
        "laravel/framework": "5.4.*",
        "pusher/pusher-php-server": "^2.6",
        "predis/predis": "^1.1",
        "laravel/cashier": "~7.0",
        "laravel/socialite": "^3.0",
        "socialiteproviders/instagram": "^3.0",
        "fideloper/proxy": "3.*",
        "mpociot/teamwork": "~5.0",
        "zizaco/entrust": "5.2.x-dev",
        "schuppo/password-strength": "~1.5",
        "laravelcollective/html": "5.4.*",
        "guzzlehttp/guzzle": "~6.0",
        "pda/pheanstalk": "~3.0",
        "aws/aws-sdk-php" : "3.*",
        "pragmarx/firewall": "1.0.8",
        "propaganistas/laravel-phone": "~2.0",
        "intervention/image": "2.*",
        "league/flysystem-aws-s3-v3": "~1.0",
        "league/csv" : "*",
        "rap2hpoutre/laravel-log-viewer": "dev-master",
        "ipunkt/laravel-analytics": "^1.2",
        "oriceon/oauth-5-laravel": "dev-master",
        "drewm/mailchimp-api": "^2.2",
        "snipe/banbuilder": "^2.2",
        "maatwebsite/excel": "^2.1",
        "roumen/sitemap": "^2.6",
        "cmgmyr/messenger": "~2.0",
        "spatie/laravel-translatable": "dev-master",
        "jrm2k6/cloudder" : "*",
        "jenssegers/date": "dev-master",
        "spinen/laravel-geometry": "^0.2.0",
        "sparkpost/sparkpost": "^1.2",
        "barryvdh/laravel-debugbar": "^2.2",
        "watson/rememberable": "^2.0",
        "rtconner/laravel-tagging": "~2.1",
        "rtconner/laravel-likeable": "~1.2",
        "lecturize/laravel-followers" : "dev-master",
        "cviebrock/eloquent-sluggable" : "^4.1",
        "spatie/eloquent-sortable": "^2.1",
        "spatie/laravel-medialibrary": "^4.9",
        "artesaos/seotools": "^0.9.2",
        "barryvdh/laravel-dompdf": "^0.7.0",
        "baum/baum": "~1.1",
        "geoip2/geoip2":"~2.0",
        "willvincent/laravel-rateable": "~1.0",

        "fhmatch/flysystem-azure": "^1.0",
        "jlapp/swaggervel": "dev-master",
        "maknz/slack-laravel": "*",
        "torann/currency": "1.0.5",
        "tymon/jwt-auth": "0.5.10",
        "musonza/groups": "^1.0",
        "jenssegers/agent": "^2.4",
        "eluceo/ical": "^0.11.0",
        "jeroendesloovere/vcard": "^1.3",
        "milon/barcode": "^5.2",
        "laravel/tinker": "^1.0",
        "laravel-notification-channels/twilio": "^2.0",
        "microsoft/azure-storage": "^0.13.0",
        "laravel/scout": "^3.0",
        "tamayo/laravel-scout-elastic": "^3.0",
        "elasticsearch/elasticsearch": "^5.2",
        "damiantw/laravel-scout-mysql-driver": "^1.0",
        "hootlex/laravel-friendships": "dev-master",
        "greggilbert/recaptcha": "^2.2@dev"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "FHMatch\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "extra": {

    },
    "repositories": {
         "followers":{
            "type": "vcs",
            "url": "https://github.com/fhmatch/lecturize-followers-stub"
        },
        "slack":{
            "packagist": false,
            "type": "vcs",
            "url": "https://github.com/connorjburton/slack-laravel.git"
        },
        "azure":{
            "packagist": false,
            "type": "vcs",
            "url": "https://github.com/fhmatch/flysystem-azure-fork"
        }
    }
}
mikebronner commented 7 years ago

What is the error message you get when you try composer require toin0u/geocoder-laravel?

alexc-hollywood commented 7 years ago

Not resolvable. Just got it to work somehow through composer update. Had to install Recaptcha first, do a remove, and then put it back into require() before updating the lot. Very strange.

mikebronner commented 7 years ago

Sometimes the vendors directory gets out of whack. It often helps to completely delete it and do a fresh composer update from scratch. Sounds like you got it sorted, closing issue. :)