From babd691bf6b9912fa02d84351398deb0dbc7ac11 Mon Sep 17 00:00:00 2001 From: Lorna Jane Mitchell Date: Tue, 16 Apr 2019 11:31:52 +0100 Subject: [PATCH] Add support for app name in user agent, and some defaults --- config/nexmo.php | 12 ++++++++++++ src/NexmoServiceProvider.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config/nexmo.php b/config/nexmo.php index cce171e..372690e 100644 --- a/config/nexmo.php +++ b/config/nexmo.php @@ -42,4 +42,16 @@ 'private_key' => function_exists('env') ? env('NEXMO_PRIVATE_KEY', '') : '', 'application_id' => function_exists('env') ? env('NEXMO_APPLICATION_ID', '') : '', + /* + |-------------------------------------------------------------------------- + | Application Identifiers + |-------------------------------------------------------------------------- + | + | Add an application name and version here to identify your application when + | making API calls + | + */ + + 'app' => ['name' => function_exists('env') ? env('NEXMO_APP_NAME', 'NexmoLaravel') : 'NexmoLaravel', + 'version' => function_exists('env') ? env('NEXMO_APP_VERSION', '1.1.2') : '1.1.2'] ]; diff --git a/src/NexmoServiceProvider.php b/src/NexmoServiceProvider.php index 5f5bd67..46fcabe 100644 --- a/src/NexmoServiceProvider.php +++ b/src/NexmoServiceProvider.php @@ -78,7 +78,7 @@ protected function createNexmoClient(Config $config) } // Get Client Options. - $options = array_diff_key($config->get('nexmo'), ['private_key', 'application_id', 'api_key', 'api_secret', 'shared_secret']); + $options = array_diff_key($config->get('nexmo'), ['private_key', 'application_id', 'api_key', 'api_secret', 'shared_secret', 'app']); // Do we have a private key? $privateKeyCredentials = null;