For some reasons Listener not worked. I made 3 Log points - at controller,at event and at listener. "Fire event" point and "Event file" are ok, but "Send SMS" dont work. What it can be?
Listener
$user = User::find($event->userId);
if (!is_null($user->phone_verified_at)) {
Log::info('Send SMS', (array) $user);
PhoneSms::sendSMS($user->phone, trans(config('sms.'.$event->type)), true);
}
Event
public function __construct($userId, $type)
{
Log::info('Event file', (array) $userId);
$this->userId = $userId;
$this->type = $type;
}
Controller
Log::info('Fire event', (array) $user);
event(new UserDataChanged($user_id, 'not_success_enter'));
Aucun commentaire:
Enregistrer un commentaire