天天看点

Laravel技巧集锦(24):密码重置功能

准备:

密码重置功能如果无法使用laravel自带的,就可以用sendcloud代替

1、找到ForgerPasswordController.php

发现使用了 use SendsPasswordResetEmails;

2、定位找到vendor\laravel\framework\src\Illuminate\Foundation\Auth\SendsPasswordResetEmails.php

发现 $this->broker()->sendResetLink

public function sendPasswordResetNotification($token)
    {
        $data = [
            'url'=>url('password/reset',$token),
        ];
        $template =new SendCloudTemplate('***',$data);
        \Mail::raw($template,function ($message){
            $message->from('***@****','***');
            $message->to($this->email);
        });
    }