stevebauman / location

Detect a users location by their IP Address.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blocker: Call to undefined method Stevebauman\Location\Facades\Location::get()

opened this issue · comments

Hello!

I want to use your great composer package to detect the user location.

I add your package within my composer file and add the following lines to the config\app.php

 'providers'       => [
         ....
         'Stevebauman\Location\LocationServiceProvider',
 ]

  'aliases'       => [
         ....
         'Location'      => 'Stevebauman\Location\Facades\Location',
 ]

I used it in the app\Providers\AppServiceProvider in the following way:

 if ( !Session::has( 'language' ) ) {
        $location = \Location::get();
        \Config::set('app.locale', $location);
 }

After that I want to test it and I get the error message

Call to undefined method Stevebauman\Location\Facades\Location::get()

Can u help me with this problem ?

Greetings!

Addional Information:

When I import the facade with use statment I've got the following error message:

Class location does not exist

I am also seeing this issue

This is due to registering your application service provider before the Location service provider.