我无法传递sendSms
给toHistory
方法。它始终设置为false
。我怎样才能正确地做到这一点?
class SendMessage extends Notification implements ShouldQueue
{
use Queueable;
public $sendSms;
public function via($notifiable)
{
$this->sendSms = true;
}
public function toHistory($notifiable) {
echo $this->sendSms; //return false
}
}