最佳答案
                
                                    我是一开始是可以的,做到后面就不行了,原因如下https://learnku.com/laravel/t/22736
就是后面重写了notify,导致回复时发送邮件通知的功能->通知的用户是当前用户和发送验证链接重复了。
//User.php 改成了
public function notify($instance){
        // 只有数据库类型通知才需提醒,直接发送 Email 或者其他的都 Pass
        if (method_exists($instance, 'toDatabase')) {
            $this->increment('notification_count');
            // 如果要通知的人是当前用户,就不必通知了!
            if ($this->id == Auth::id()) {
                return;
            }
        }
        $this->laravelNotify($instance);
    } 讨论数量: 
            
            
    
            我是一开始是可以的,做到后面就不行了,原因如下https://learnku.com/laravel/t/22736
就是后面重写了notify,导致回复时发送邮件通知的功能->通知的用户是当前用户和发送验证链接重复了。
//User.php 改成了
public function notify($instance){
        // 只有数据库类型通知才需提醒,直接发送 Email 或者其他的都 Pass
        if (method_exists($instance, 'toDatabase')) {
            $this->increment('notification_count');
            // 如果要通知的人是当前用户,就不必通知了!
            if ($this->id == Auth::id()) {
                return;
            }
        }
        $this->laravelNotify($instance);
    } 
           
         
             
             
                     
                     
             
             
           
           关于 LearnKu
                关于 LearnKu
               
                     
                     
                     粤公网安备 44030502004330号
 粤公网安备 44030502004330号 
 
推荐文章: