Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Add config file
Browse files Browse the repository at this point in the history
  • Loading branch information
kduma committed Feb 10, 2018
1 parent cc5caa2 commit cd101f2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ And following facade to facades array:

'SMS' => KDuma\SMS\Facades\SMS::class,

Publish `sms.php` config file using following command:

php artisan vendor:publish --provider="KDuma\SMS\SMSServiceProvider"

Now You can install and configure SMS channels and drivers. Configuration options are available in drivers readme's.

## Available Drivers

- SerwerSMS.pl - [kduma/sms-driver-serwersms](https://github.com/kduma-OSS/L5-SMS-Driver-SerwerSMS)
- JustSend.pl - [kduma/sms-driver-justsend](https://github.com/kduma-OSS/L5-SMS-Driver-JustSend)

## Usage
``` php
SMS::send('phone number', 'Message.');
Expand Down
36 changes: 36 additions & 0 deletions config/sms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

return [

'default' => env('SMS_CHANNEL', 'log'),

'channels' => [

'log' => [
'driver' => 'log',
'level' => 'debug',
],

// to use this driver you need to require kduma/sms-driver-serwersms
'serwersms' => [
'driver' => 'serwersms',
'login' => env('SMS_SERWERSMS_LOGIN'),
'password' => env('SMS_SERWERSMS_PASSWORD'),
'sender' => 'INFORMACJA',
'eco' => true,
'flash' => true,

'test' => true,
],

// to use this driver you need to require kduma/sms-driver-justsend
'justsend' => [
'driver' => 'justsend',
'key' => env('SMS_JUSTSEND_KEY'),
'sender' => 'INFORMACJA',
'eco' => true,
],

],

];
8 changes: 7 additions & 1 deletion src/SMSServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class SMSServiceProvider extends ServiceProvider
*/
public function boot()
{
//
$this->publishes([
__DIR__.'/../config/sms.php' => config_path('sms.php'),
]);
}

/**
Expand All @@ -22,6 +24,10 @@ public function boot()
*/
public function register()
{
$this->mergeConfigFrom(
__DIR__.'/../config/sms.php', 'sms'
);

$this->app->singleton(SMSManager::class, function () {
return new SMSManager($this->app);
});
Expand Down

0 comments on commit cd101f2

Please sign in to comment.