6
0
Fork 0
jiqu-library-server/app/Notifications/SmsCodeCreated.php

46 lines
948 B
PHP

<?php
namespace App\Notifications;
use App\Models\SmsCode;
use App\Notifications\Channels\SmsChannel;
use App\Notifications\Messages\SmsMessage;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
class SmsCodeCreated extends Notification implements ShouldQueue
{
use Queueable;
/**
* @param \App\Models\SmsCode $smsCode
*/
public function __construct(
protected SmsCode $smsCode,
) {
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [SmsChannel::class];
}
/**
* 发送短信消息通知.
*
* @param mixed $notifiable
* @return \App\Notifications\Messages\SmsMessage
*/
public function toSms($notifiable): SmsMessage
{
return new SmsMessage();
}
}