Skip to content

Commit ded201b

Browse files
committed
Add a sandbox flag to the config
1 parent dc10bb9 commit ded201b

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/Channels/SmsChannel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Elimuswift\SMS\Channels;
44

5+
use Elimuswift\SMS\Facades\SMS;
56
use Illuminate\Notifications\Notification;
67

78
class SmsChannel
@@ -16,7 +17,7 @@ public function send($notifiable, Notification $notification)
1617
{
1718
$message = $notification->toSms($notifiable);
1819
$to = $message->content['to'];
19-
app()->sms->send(
20+
SMS::send(
2021
$message->content['smsView'],
2122
$message->content['data'],
2223
function ($sms) use ($to) {

src/DriverManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function setDefaultDriver($name)
4040
public function createAfricastalkingDriver()
4141
{
4242
$config = $this->app['config']->get('sms.africastalking', []);
43-
$adapter = new Gateway($config['username'], $config['api_key']);
43+
$adapter = new Gateway($config['username'], $config['api_key'], $config['sandbox']);
4444

4545
return new Drivers\AfricasTalking($adapter);
4646
}

src/config/sms.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
'africastalking' => [
1212
'api_key' => env('AT_API_KEY', 'africastalking.api_key'),
1313
'username' => env('AT_USERNAME', 'africastalking.username'),
14+
'sandbox' => true,
1415
],
1516
'nexmo' => [
1617
'api_key' => env('NEXMO_KEY', 'Your Nexmo API key'),
1718
'api_secret' => env('NEXMO_SECRET', 'Your Nexmo API secret'),
18-
'encoding' => env('NEXMO_ENCODING', 'unicode'), // Can be "unicode" or "gsm"
19+
'encoding' => env('NEXMO_ENCODING', 'unicode'), // Can be "unicode" or "gsm"
1920
],
2021
'twilio' => [
2122
'account_sid' => env('TWILIO_SID', 'Your Twilio SID'),

0 commit comments

Comments
 (0)