В основном есть ошибочное чтение, которое вызывает событие под названием «AbnormalReadingWasTaken», в котором я зарегистрировал двух слушателей под «AbnormalReadingWasTaken» в моем «EventServiceProviders», где первый слушатель «AddReadingsToAlertsTable» работает отлично, но другой прослушиватель SendAlertSMS не работает. Что мне не хватает, может ли кто-нибудь помочь мне в этом? Я считаю, что это имеет какое-то отношение к скручивающемуся скрипту nexmo sms?Nexmo sms laravel не работает
<?php
namespace App\Listeners;
use App\Events\AbnormalReadingWasTaken;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class SendAlertSMS
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param AbnormalReadingWasTaken $event
* @return void
*/
public function handle(AbnormalReadingWasTaken $event)
{
$url = 'https://rest.nexmo.com/sms/json?' . http_build_query([
'api_key' => 'xxxxx',
'api_secret' => 'xxxxx',
'to' => 'xxxxx',
'from' => 'xxxxxx',
'text' => 'Hello from Nexmo'
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
}
}