The sms channel is registered automatically.
sms
use Alizeinodin\SmsApi\Notifications\NotificationMessage; use Illuminate\Notifications\Notification; class LoginCodeNotification extends Notification { public function __construct(private string $code) {} public function via($notifiable): array { return ['sms']; // or Sms::otpChannels() } public function toSms($notifiable): NotificationMessage { return NotificationMessage::create() ->template('otp-login', ['CODE' => $this->code]) ->failover(['smsir', 'kavenegar']); } }
$user->notify(new LoginCodeNotification('12345'));
There was an error while loading. Please reload this page.
SMSApi