This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Message Queue and Frontend bug fixes
- Loading branch information
1 parent
7c61714
commit e4455a6
Showing
8 changed files
with
324 additions
and
156 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
namespace App\Jobs; | ||
use App\Jobs\Job; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Contracts\Bus\SelfHandling; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
class SendSMS extends Job implements SelfHandling, ShouldQueue | ||
{ | ||
use SerializesModels, InteractsWithQueue; | ||
/** | ||
* @var | ||
*/ | ||
private $phone; | ||
/** | ||
* @var | ||
*/ | ||
private $message; | ||
/** | ||
* Create a new job instance. | ||
* | ||
* @param $phone | ||
* @param $message | ||
*/ | ||
public function __construct(array $phone, $message) | ||
{ | ||
$this->phone = implode(',',$phone); | ||
$this->message = $message; | ||
echo $this->message; | ||
} | ||
/** | ||
* Execute the job. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
//Your authentication key | ||
$authKey = ""; | ||
//Define route | ||
$route = "4"; | ||
|
||
//Sender ID,While using route4 sender id should be 6 characters long. | ||
$senderId = "GDGVIT"; | ||
//Prepare you post parameters | ||
$postData = array( | ||
'authkey' => $authKey, | ||
'mobiles' => $this->phone, | ||
'message' => $this->message, | ||
'sender' => $senderId, | ||
'route' => $route | ||
); | ||
//API URL | ||
$url = "https://control.msg91.com/api/sendhttp.php"; | ||
// init the resource | ||
$ch = curl_init(); | ||
curl_setopt_array($ch, array( | ||
CURLOPT_URL => $url, | ||
CURLOPT_RETURNTRANSFER => true, | ||
CURLOPT_POST => true, | ||
CURLOPT_POSTFIELDS => $postData | ||
//,CURLOPT_FOLLOWLOCATION => true | ||
)); | ||
//Ignore SSL certificate verification | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); | ||
//get response | ||
$output = curl_exec($ch); | ||
curl_close($ch); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters