File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 88
99use GeoIp2 \Exception \AddressNotFoundException ;
1010
11+ use Illuminate \Support \Arr ;
1112use Illuminate \Config \Repository ;
1213use Illuminate \Session \Store as SessionStore ;
1314
@@ -174,11 +175,18 @@ private function locate_maxmind($ip)
174175 $ settings = $ this ->config ->get ('geoip.maxmind ' );
175176
176177 if (empty ($ this ->maxmind )) {
177- if ($ settings ['type ' ] === 'web_service ' ) {
178- $ this ->maxmind = new Client ($ settings ['user_id ' ], $ settings ['license_key ' ], $ settings ['locales ' ]);
178+ if (Arr::get ($ settings , 'type ' ) === 'web_service ' ) {
179+ $ this ->maxmind = new Client (
180+ Arr::get ($ settings , 'user_id ' ),
181+ Arr::get ($ settings , 'license_key ' ),
182+ Arr::get ($ settings , 'locales ' , ['en ' ])
183+ );
179184 }
180185 else {
181- $ this ->maxmind = new Reader ($ settings ['database_path ' ], $ settings ['locales ' ]);
186+ $ this ->maxmind = new Reader (
187+ Arr::get ($ settings , 'database_path ' ),
188+ Arr::get ($ settings , 'locales ' , ['en ' ])
189+ );
182190 }
183191 }
184192
You can’t perform that action at this time.
0 commit comments