File tree Expand file tree Collapse file tree 5 files changed +52
-2
lines changed
Expand file tree Collapse file tree 5 files changed +52
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ php artisan vendor:publish --provider="Tartan\IranianSms\SmsServiceProvider" --t
4545* mehrafzar مهر افزار
4646* kavenegar کاوه نگار
4747* smsir اسمس آی آر
48+ * ghasedak قاصدک
4849
4950
5051
@@ -71,6 +72,10 @@ return [
7172 'user' => env('IRANIANSMS_SMSIR_USER', 'test'),
7273 'pass' => env('IRANIANSMS_SMSIR_PASS', 'test'),
7374 'line_no' => env('IRANIANSMS_SMSIR_LINENO', 'test'),
74- ]
75+ ],
76+ 'ghasedak'=> [
77+ 'api_key' => env('IRANIANSMS_GHASEDAK_APIKEY', 'test'),
78+ 'sender' => env('IRANIANSMS_GHASEDAK_SENDER', 'test'),
79+ ],
7580];
7681```
Original file line number Diff line number Diff line change 2828 "php" : " >=5.4" ,
2929 "illuminate/support" : " 5.x.x" ,
3030 "ext-soap" : " *" ,
31- "ext-curl" : " *"
31+ "ext-curl" : " *" ,
32+ "ghasedak/php" :" dev-master"
3233 },
3334 "require-dev" : {
3435 "phpunit/phpunit" : " ~4.0"
Original file line number Diff line number Diff line change 1919 'pass ' => env ('IRANIANSMS_SMSIR_PASS ' , 'test ' ),
2020 'line_no ' => env ('IRANIANSMS_SMSIR_LINENO ' , 'test ' ),
2121 ],
22+ 'ghasedak ' => [
23+ 'api_key ' => env ('IRANIANSMS_GHASEDAK_APIKEY ' , 'test ' ),
24+ 'sender ' => env ('IRANIANSMS_GHASEDAK_SENDER ' , 'test ' ),
25+ ],
2226 'slack ' => [
2327 'url ' => env ('IRANIANSMS_SLACK_URL ' )
2428 ]
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Tartan \IranianSms \Adapter ;
4+
5+ use Ghasedak \GhasedakApi ;
6+
7+ class Ghasedak extends AdapterAbstract implements AdapterInterface
8+ {
9+
10+ private $ credential = [
11+ 'api_key ' => '' ,
12+ 'sender ' => ''
13+ ];
14+
15+ public function __construct ()
16+ {
17+ $ this ->credential ['api_key ' ] = config ('iranian_sms.ghasedak.api_key ' );
18+ $ this ->credential ['sender ' ] = config ('iranian_sms.ghasedak.sender ' );
19+ }
20+
21+ public function send (String $ number , String $ message )
22+ {
23+
24+ $ number = $ this ->filterNumber ($ number );
25+
26+ $ api = new GhasedakApi ($ this ->credential ['api_key ' ]);
27+
28+ return $ api ->SendSimple (
29+ $ number ,
30+ $ message ,
31+ $ this ->credential ['sender ' ]
32+ );
33+
34+ }
35+ }
Original file line number Diff line number Diff line change 22
33namespace Tartan \IranianSms ;
44
5+ use Tartan \IranianSms \Adapter \Ghasedak ;
56use Tartan \IranianSms \Adapter \MehrAfzar ;
67use Tartan \IranianSms \Adapter \KaveNegar ;
78use Tartan \IranianSms \Adapter \Slack ;
@@ -38,10 +39,14 @@ public function make($adapter = '')
3839 case 'slack ' :
3940 return new Slack ();
4041 break ;
42+ case 'ghasedak ' :
43+ return new Ghasedak ();
44+ break ;
4145 default :
4246 throw new Exception ('Adapter not defined ' );
4347 break ;
4448 }
49+
4550 }
4651}
4752
You can’t perform that action at this time.
0 commit comments