1 | <?php |
||
14 | class IPStackFinderServiceProvider extends ServiceProvider |
||
15 | { |
||
16 | /** @var string */ |
||
17 | const BASE_URI = 'http://api.ipstack.com/'; |
||
18 | |||
19 | /** @var string */ |
||
20 | const DEFAULT_LANGUAGE = 'en'; |
||
21 | |||
22 | /** @var array $supportedLanguages */ |
||
23 | private $supportedLanguages = [ |
||
24 | 'en', // English/US |
||
25 | 'de', // German |
||
26 | 'es', // Spanish |
||
27 | 'fr', // French |
||
28 | 'ja', // Japanese |
||
29 | 'pt-br', // Portugues (Brazil) |
||
30 | 'ru', // Russian |
||
31 | 'zh', // Chinese |
||
32 | ]; |
||
33 | |||
34 | /** |
||
35 | * Bootstrap the application services. |
||
36 | */ |
||
37 | public function boot() |
||
45 | |||
46 | /** |
||
47 | * Register the application services. |
||
48 | */ |
||
49 | public function register() |
||
74 | |||
75 | /** |
||
76 | * Defensive programming to not give ipstack.com an invalid language param. |
||
77 | * If the .env or config file provided language code is not valid, return the default. |
||
78 | * @return string |
||
79 | */ |
||
80 | private function getLanguage() : string |
||
88 | } |
||
89 |