Laravel 8 短信通知路由
2021-07-19 10:56 更新
要将 Nexmo 通知路由到正确的电话号码,请在可通知实体上定义一个 routeNotificationForNexmo
方法:
<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Nexmo channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForNexmo($notification)
{
return $this->phone_number;
}
}
以上内容是否对您有帮助:
更多建议: