File tree 4 files changed +30
-4
lines changed
4 files changed +30
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,15 @@ CURRENCYLAYER_ACCESS_KEY=your-key-here
40
40
41
41
You can find your access key in [ Currencylayer Dashboard] ( https://currencylayer.com/dashboard ) .
42
42
43
+ ## Configuration
44
+
45
+ After publishing configuration file it will be available here: ` app/config/currencylayer.php `
46
+
47
+ It has following settings:
48
+
49
+ * ` access_key ` - currencylayer.com access key, by default uses value from ` .env ` file
50
+ * ` https_connection ` - if set to ` true ` all calls to currencylayer API endpoint will be over HTTPS, instead of default HTTP
51
+
43
52
## Usage
44
53
45
54
You can type-hint ` Orkhanahmadov\LaravelCurrencylayer\Contracts\CurrencyService ` to inject it from container:
Original file line number Diff line number Diff line change 11
11
*/
12
12
13
13
'access_key ' => env ('CURRENCYLAYER_ACCESS_KEY ' ),
14
+
15
+ /*
16
+ |--------------------------------------------------------------------------
17
+ | HTTPs connection to currencylayer endpoint
18
+ |--------------------------------------------------------------------------
19
+ |
20
+ | Paid customers can use secure HTTPS connection to currencylayer API endpoint.
21
+ | Set this to "true" if you want to use HTTPS.
22
+ |
23
+ */
24
+
25
+ 'https_connection ' => false ,
14
26
];
Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ class LaravelCurrencylayerServiceProvider extends ServiceProvider
20
20
public function boot (): void
21
21
{
22
22
$ this ->app ->bind (Client::class, static function () {
23
- // todo: add https config
24
- return new CurrencylayerClient (config ('currencylayer.access_key ' ));
23
+ return new CurrencylayerClient (
24
+ config ('currencylayer.access_key ' ),
25
+ config ('currencylayer.https_connection ' )
26
+ );
25
27
});
26
28
$ this ->app ->bind (CurrencyService::class, Currencylayer::class);
27
29
@@ -49,8 +51,10 @@ public function register(): void
49
51
$ this ->mergeConfigFrom (__DIR__ .'/../config/config.php ' , 'currencylayer ' );
50
52
51
53
$ this ->app ->singleton ('currencylayer ' , static function () {
52
- // todo: add https config
53
- return new Currencylayer (new CurrencylayerClient (config ('currencylayer.access_key ' )));
54
+ return new Currencylayer (new CurrencylayerClient (
55
+ config ('currencylayer.access_key ' ),
56
+ config ('currencylayer.https_connection ' )
57
+ ));
54
58
});
55
59
56
60
if ($ this ->app ->runningInConsole ()) {
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ public function endDate($date): Client
79
79
80
80
/**
81
81
* @return Quotes
82
+ * @throws \Exception
82
83
*/
83
84
public function quotes (): Quotes
84
85
{
You can’t perform that action at this time.
0 commit comments