Skip to content

Commit 7691b9c

Browse files
committed
Merge pull request #6 from imknight/master
make it Laravel 5 compatible and load the vendor config nicely
2 parents 5271a0e + 6f219ba commit 7691b9c

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Nexmo for Laravel 4
1+
Nexmo for Laravel 5
22
==============
33

44
Implements a service for Nexmo messaging based on
@@ -21,6 +21,10 @@ Add a ServiceProvider to your providers array in `app/config/app.php`:
2121

2222
)
2323

24+
### Publish the Vendor Config
25+
26+
php artisan vendor:publish --provider="Artistan\Nexmo\NexmoServiceProvider"
27+
2428
### Usage - work in progress
2529

2630
Sending SMS via the Nexmo SMS gateway.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": ">=5.3.0",
22-
"illuminate/support": "4.*"
22+
"illuminate/support": "5.*"
2323
},
2424
"require-dev":{
2525
"phpunit/phpunit": "3.7.*",

src/Artistan/Nexmo/NexmoServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class NexmoServiceProvider extends ServiceProvider {
2121
*/
2222
public function boot()
2323
{
24-
$this->package('artistan/nexmo');
24+
$this->publishes([__DIR__.'/../../config/nexmo.php' => config_path('nexmo.php')]);
2525
}
2626

2727
/**

src/Artistan/Nexmo/Service/Account.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function __construct ($api_key='', $api_secret='') {
3434
$this->nx_key = $api_key;
3535
$this->nx_secret = $api_secret;
3636
} else {
37-
$this->nx_key = \Config::get('nexmo::auth.api_key');
38-
$this->nx_secret = \Config::get('nexmo::auth.api_secret');
37+
$this->nx_key = \Config::get('nexmo.api_key');
38+
$this->nx_secret = \Config::get('nexmo.api_secret');
3939
}
4040

4141
if(empty($this->nx_key) || empty($this->nx_secret)){
@@ -243,4 +243,4 @@ private function apiCall($command, $data=array()) {
243243
);
244244

245245
}
246-
}
246+
}

src/Artistan/Nexmo/Service/Message/Sms.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public function __construct ($api_key='', $api_secret='') {
4949
$this->nx_key = $api_key;
5050
$this->nx_secret = $api_secret;
5151
} else {
52-
$this->nx_key = \Config::get('nexmo::auth.api_key');
53-
$this->nx_secret = \Config::get('nexmo::auth.api_secret');
52+
$this->nx_key = \Config::get('nexmo.api_key');
53+
$this->nx_secret = \Config::get('nexmo.api_secret');
5454
}
5555

5656
if(empty($this->nx_key) || empty($this->nx_secret)){
@@ -398,4 +398,4 @@ public function reply ($message) {
398398

399399
return $this->sendText($this->from, $this->to, $message);
400400
}
401-
}
401+
}

src/config/auth.php renamed to src/config/nexmo.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
2-
/**
3-
* User: Charles Peterson
4-
*/
2+
53
return array(
64
'api_key' => 'api_key',
75
'api_secret' => 'api_secret'

0 commit comments

Comments
 (0)