diff --git a/README.md b/README.md index 1702ae3..1f428a9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Nexmo for Laravel 4 +Nexmo for Laravel 5 ============== Implements a service for Nexmo messaging based on @@ -21,6 +21,10 @@ Add a ServiceProvider to your providers array in `app/config/app.php`: ) +### Publish the Vendor Config + +php artisan vendor:publish --provider="Artistan\Nexmo\NexmoServiceProvider" + ### Usage - work in progress Sending SMS via the Nexmo SMS gateway. diff --git a/composer.json b/composer.json index bee95e1..f2c0b57 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ ], "require": { "php": ">=5.3.0", - "illuminate/support": "4.*" + "illuminate/support": "5.*" }, "require-dev":{ "phpunit/phpunit": "3.7.*", diff --git a/src/Artistan/Nexmo/NexmoServiceProvider.php b/src/Artistan/Nexmo/NexmoServiceProvider.php index 253d7b0..6b22d1b 100644 --- a/src/Artistan/Nexmo/NexmoServiceProvider.php +++ b/src/Artistan/Nexmo/NexmoServiceProvider.php @@ -21,7 +21,7 @@ class NexmoServiceProvider extends ServiceProvider { */ public function boot() { - $this->package('artistan/nexmo'); + $this->publishes([__DIR__.'/../../config/nexmo.php' => config_path('nexmo.php')]); } /** diff --git a/src/Artistan/Nexmo/Service/Account.php b/src/Artistan/Nexmo/Service/Account.php index ea6a4b2..e7926e0 100644 --- a/src/Artistan/Nexmo/Service/Account.php +++ b/src/Artistan/Nexmo/Service/Account.php @@ -34,8 +34,8 @@ public function __construct ($api_key='', $api_secret='') { $this->nx_key = $api_key; $this->nx_secret = $api_secret; } else { - $this->nx_key = \Config::get('nexmo::auth.api_key'); - $this->nx_secret = \Config::get('nexmo::auth.api_secret'); + $this->nx_key = \Config::get('nexmo.api_key'); + $this->nx_secret = \Config::get('nexmo.api_secret'); } if(empty($this->nx_key) || empty($this->nx_secret)){ @@ -243,4 +243,4 @@ private function apiCall($command, $data=array()) { ); } -} \ No newline at end of file +} diff --git a/src/Artistan/Nexmo/Service/Message/Sms.php b/src/Artistan/Nexmo/Service/Message/Sms.php index 252f9a2..6f4eac9 100644 --- a/src/Artistan/Nexmo/Service/Message/Sms.php +++ b/src/Artistan/Nexmo/Service/Message/Sms.php @@ -49,8 +49,8 @@ public function __construct ($api_key='', $api_secret='') { $this->nx_key = $api_key; $this->nx_secret = $api_secret; } else { - $this->nx_key = \Config::get('nexmo::auth.api_key'); - $this->nx_secret = \Config::get('nexmo::auth.api_secret'); + $this->nx_key = \Config::get('nexmo.api_key'); + $this->nx_secret = \Config::get('nexmo.api_secret'); } if(empty($this->nx_key) || empty($this->nx_secret)){ @@ -398,4 +398,4 @@ public function reply ($message) { return $this->sendText($this->from, $this->to, $message); } -} \ No newline at end of file +} diff --git a/src/config/auth.php b/src/config/nexmo.php similarity index 70% rename from src/config/auth.php rename to src/config/nexmo.php index 43a4e29..d0209f7 100644 --- a/src/config/auth.php +++ b/src/config/nexmo.php @@ -1,7 +1,5 @@ 'api_key', 'api_secret' => 'api_secret'