Skip to content

Commit

Permalink
Merge pull request #6 from imknight/master
Browse files Browse the repository at this point in the history
make it Laravel 5 compatible and load the vendor config nicely
  • Loading branch information
Artistan committed Oct 29, 2015
2 parents 5271a0e + 6f219ba commit 7691b9c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Nexmo for Laravel 4
Nexmo for Laravel 5
==============

Implements a service for Nexmo messaging based on
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.*"
"illuminate/support": "5.*"
},
"require-dev":{
"phpunit/phpunit": "3.7.*",
Expand Down
2 changes: 1 addition & 1 deletion src/Artistan/Nexmo/NexmoServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')]);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Artistan/Nexmo/Service/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down Expand Up @@ -243,4 +243,4 @@ private function apiCall($command, $data=array()) {
);

}
}
}
6 changes: 3 additions & 3 deletions src/Artistan/Nexmo/Service/Message/Sms.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down Expand Up @@ -398,4 +398,4 @@ public function reply ($message) {

return $this->sendText($this->from, $this->to, $message);
}
}
}
4 changes: 1 addition & 3 deletions src/config/auth.php → src/config/nexmo.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
/**
* User: Charles Peterson
*/

return array(
'api_key' => 'api_key',
'api_secret' => 'api_secret'
Expand Down

0 comments on commit 7691b9c

Please sign in to comment.