Skip to content

Commit f381350

Browse files
authored
..
1 parent 30e15d5 commit f381350

File tree

1 file changed

+155
-0
lines changed

1 file changed

+155
-0
lines changed

src/config/geoip.php

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Logging Configuration
8+
|--------------------------------------------------------------------------
9+
|
10+
| Here you may configure the log settings for when a location is not found
11+
| for the IP provided.
12+
|
13+
*/
14+
15+
'log_failures' => true,
16+
17+
/*
18+
|--------------------------------------------------------------------------
19+
| Include Currency in Results
20+
|--------------------------------------------------------------------------
21+
|
22+
| When enabled the system will do it's best in deciding the user's currency
23+
| by matching their ISO code to a preset list of currencies.
24+
|
25+
*/
26+
27+
'include_currency' => true,
28+
29+
/*
30+
|--------------------------------------------------------------------------
31+
| Default Service
32+
|--------------------------------------------------------------------------
33+
|
34+
| Here you may specify the default storage driver that should be used
35+
| by the framework using the services listed below.
36+
|
37+
*/
38+
39+
'service' => null,
40+
41+
/*
42+
|--------------------------------------------------------------------------
43+
| Storage Specific Configuration
44+
|--------------------------------------------------------------------------
45+
|
46+
| Here you may configure as many storage drivers as you wish.
47+
|
48+
*/
49+
50+
'services' => [
51+
52+
'maxmind_database' => [
53+
'class' => \Torann\GeoIP\Services\MaxMindDatabase::class,
54+
'database_path' => storage_path('app/geoip.mmdb'),
55+
'update_url' => sprintf('https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=%s&suffix=tar.gz', env('MAXMIND_LICENSE_KEY')),
56+
'locales' => ['en'],
57+
],
58+
59+
'maxmind_api' => [
60+
'class' => \Torann\GeoIP\Services\MaxMindWebService::class,
61+
'user_id' => env('MAXMIND_USER_ID'),
62+
'license_key' => env('MAXMIND_LICENSE_KEY'),
63+
'locales' => ['en'],
64+
],
65+
66+
'ipgeolocation' => [
67+
'class' => \Torann\GeoIP\Services\IPGeoLocation::class,
68+
'secure' => true,
69+
'key' => env('IPGEOLOCATION_KEY'),
70+
'continent_path' => storage_path('app/continents.json'),
71+
'lang' => 'en',
72+
],
73+
74+
'ipdata' => [
75+
'class' => \Torann\GeoIP\Services\IPData::class,
76+
'key' => env('IPDATA_API_KEY'),
77+
'secure' => true,
78+
],
79+
80+
'ipfinder' => [
81+
'class' => \Torann\GeoIP\Services\IPFinder::class,
82+
'key' => env('IPFINDER_API_KEY'),
83+
'secure' => true,
84+
'locales' => ['en'],
85+
],
86+
87+
],
88+
89+
/*
90+
|--------------------------------------------------------------------------
91+
| Default Cache Driver
92+
|--------------------------------------------------------------------------
93+
|
94+
| Here you may specify the type of caching that should be used
95+
| by the package.
96+
|
97+
| Options:
98+
|
99+
| all - All location are cached
100+
| some - Cache only the requesting user
101+
| none - Disable cached
102+
|
103+
*/
104+
105+
'cache' => 'all',
106+
107+
/*
108+
|--------------------------------------------------------------------------
109+
| Cache Tags
110+
|--------------------------------------------------------------------------
111+
|
112+
| Cache tags are not supported when using the file or database cache
113+
| drivers in Laravel. This is done so that only locations can be cleared.
114+
|
115+
*/
116+
117+
'cache_tags' => ['torann-geoip-location'],
118+
119+
/*
120+
|--------------------------------------------------------------------------
121+
| Cache Expiration
122+
|--------------------------------------------------------------------------
123+
|
124+
| Define how long cached location are valid.
125+
|
126+
*/
127+
128+
'cache_expires' => 30,
129+
130+
/*
131+
|--------------------------------------------------------------------------
132+
| Default Location
133+
|--------------------------------------------------------------------------
134+
|
135+
| Return when a location is not found.
136+
|
137+
*/
138+
139+
'default_location' => [
140+
'ip' => '127.0.0.0',
141+
'iso_code' => 'US',
142+
'country' => 'United States',
143+
'city' => 'New Haven',
144+
'state' => 'CT',
145+
'state_name' => 'Connecticut',
146+
'postal_code' => '06510',
147+
'lat' => 41.31,
148+
'lon' => -72.92,
149+
'timezone' => 'America/New_York',
150+
'continent' => 'NA',
151+
'default' => true,
152+
'currency' => 'USD',
153+
],
154+
155+
];

0 commit comments

Comments
 (0)