also looking at this
Collection response
#52
11 files
+3638
-3582
| @@ -21,18 +21,25 @@ class Client | ||
| 21 | 21 | */ |
| 22 | 22 | protected $accessKey; |
| 23 | 23 | |
| 24 | /** | |
| 25 | * @var array | |
| 26 | */ | |
| 27 | protected $config; | |
| 28 | ||
| 24 | 29 | /** |
| 25 | 30 | * Construct Meema client. |
| 26 | 31 | * |
| 27 | 32 | * @param string $accessKey |
| 28 | 33 | */ |
| 29 | public function __construct($accessKey, $baseUrl = null) | |
| 34 | public function __construct($accessKey, $config = []) | |
| 30 | 35 | { |
| 31 | 36 | $this->initializeEnv(); |
| 32 | 37 | |
| 33 | 38 | $this->accessKey = $accessKey; |
| 34 | 39 | |
| 35 | $url = $baseUrl ?? env('BASE_URL'); | |
| 40 | $this->config = $config; | |
| 41 | ||
| 42 | $url = $config['base_url'] ?? env('BASE_URL'); | |
| 36 | 43 | |
| 37 | 44 | $this->client = new GuzzleClient([ |
| 38 | 45 | 'base_uri' => $url ?? 'https://api.mee.ma', |
| @@ -140,4 +147,14 @@ class Client | ||
| 140 | 147 | { |
| 141 | 148 | return new Favorite($this); |
| 142 | 149 | } |
| 150 | ||
| 151 | /** | |
| 152 | * Get the client config. | |
| 153 | * | |
| 154 | * @return array | |
| 155 | */ | |
| 156 | public function getConfig() | |
| 157 | { | |
| 158 | return $this->config; | |
| 159 | } | |
| 143 | 160 | } |