|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Laravelcm\AbstractIpGeolocation\IpSelector; |
| 6 | + |
| 7 | +return [ |
| 8 | + |
| 9 | + /* |
| 10 | + |-------------------------------------------------------------------------- |
| 11 | + | API Key |
| 12 | + |-------------------------------------------------------------------------- |
| 13 | + | |
| 14 | + | |
| 15 | + */ |
| 16 | + |
| 17 | + 'api_key' => env('ABSTRACT_IP_GEOLOCATION_API_KEY'), |
| 18 | + |
| 19 | + /* |
| 20 | + |-------------------------------------------------------------------------- |
| 21 | + | User IP Address |
| 22 | + |-------------------------------------------------------------------------- |
| 23 | + | By default, Abstract IP Geolocation will detect the ip address. But you can |
| 24 | + | update this configuration to include the client's ip address every time. |
| 25 | + | |
| 26 | + | If this value is set to "true", the ip will be detected using the "ip_selector" config. |
| 27 | + | |
| 28 | + */ |
| 29 | + |
| 30 | + 'include_ip' => false, |
| 31 | + |
| 32 | + /* |
| 33 | + |-------------------------------------------------------------------------- |
| 34 | + | Geolocation Fields |
| 35 | + |-------------------------------------------------------------------------- |
| 36 | + | You can include a fields value in the query parameters with a comma |
| 37 | + | separated list of the top-level keys you want to be returned. For example |
| 38 | + | "fields => 'city,region'" will return only the city and region in the response. |
| 39 | + | |
| 40 | + | see: https://docs.abstractapi.com/ip-geolocation#request-parameters |
| 41 | + */ |
| 42 | + |
| 43 | + 'fields' => null, |
| 44 | + |
| 45 | + /* |
| 46 | + |-------------------------------------------------------------------------- |
| 47 | + | Ip Selector Class |
| 48 | + |-------------------------------------------------------------------------- |
| 49 | + | You can select which class will be used to retrieve the client's ip address |
| 50 | + | or you can change it and use your own class to return the ip address. |
| 51 | + | |
| 52 | + | In case you use a custom IP selector, you may implement the |
| 53 | + | \Laravelcm\AbstractIpGeolocation\Contracts\AbstractIpInterface interface |
| 54 | + | |
| 55 | + | Available class: "IpSelector", "OriginatingIpSelector" |
| 56 | + | |
| 57 | + */ |
| 58 | + |
| 59 | + 'ip_selector' => new IpSelector(), |
| 60 | + |
| 61 | + /* |
| 62 | + |-------------------------------------------------------------------------- |
| 63 | + | Cache HTTP Request API |
| 64 | + |-------------------------------------------------------------------------- |
| 65 | + | |
| 66 | + | |
| 67 | + */ |
| 68 | + |
| 69 | + 'cache' => [ |
| 70 | + /* |
| 71 | + | By default, requests are cached to retrieve the user's ip. |
| 72 | + | If you use the "Free plan" option, caching can help you save |
| 73 | + | on requests to the Abstract IP Geolocation API. |
| 74 | + */ |
| 75 | + |
| 76 | + 'enable' => true, |
| 77 | + |
| 78 | + /* |
| 79 | + | |
| 80 | + */ |
| 81 | + |
| 82 | + 'maxsize' => 5, |
| 83 | + |
| 84 | + /* |
| 85 | + | |
| 86 | + | |
| 87 | + */ |
| 88 | + |
| 89 | + 'ttl' => 86400, |
| 90 | + ], |
| 91 | + |
| 92 | +]; |
0 commit comments