56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Facades\Sms;
|
|
|
|
use Illuminate\Support\Facades\App;
|
|
use Illuminate\Http\Request;
|
|
use Carbon\Carbon;
|
|
use SoapFault;
|
|
use SoapClient;
|
|
|
|
class SmsClass
|
|
{
|
|
public function sendSms($mobile, $msg)
|
|
{
|
|
if (App::environment('production')) {
|
|
|
|
$client = new SoapClient("http://sms1000.ir/webservice/sms.asmx?WSDL");
|
|
$date = date('d-m-y h:i:s');
|
|
$date = str_replace(" ", "T", $date);
|
|
$result = $client->Send(
|
|
array(
|
|
'Username' => 'admin',
|
|
'Password' => 'admin141',
|
|
'ShortCode' => '1000141',
|
|
'Cellphones' => $mobile,
|
|
'Message' => $msg,
|
|
'Farsi' => true,
|
|
// 'SendDate' => $date
|
|
// 'uTopic' => false,
|
|
// 'uFlash' => false
|
|
)
|
|
);
|
|
|
|
return $result->SendResult;
|
|
}
|
|
|
|
|
|
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
|
// $result = $client->doSendSMS(
|
|
// array(
|
|
// 'uUsername' => 'rms',
|
|
// 'uPassword' => 'Rms@141',
|
|
// 'uNumber' => '1000141',
|
|
// 'uCellphones' => $mobile,
|
|
// 'uMessage' => $msg,
|
|
// 'uFarsi' => true,
|
|
// 'uTopic' => false,
|
|
// 'uFlash' => false
|
|
// )
|
|
// );
|
|
// $x = $result->doSendSMSResult;
|
|
// dd($x);
|
|
// return $x;
|
|
}
|
|
}
|