You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

172 lines
4.9 KiB

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