laravel 5.7进行电子邮件验证

时间:2019-08-27 18:54:00

标签: php laravel

因此我在laravel 5.7中遇到此问题,我试图建立验证电子邮件脚本 当新的求职者选择验证邮件时,会将验证邮件发送到mailtrap。通常,验证脚本应该从数据库中选择测试求职者ID,但是问题是inmail陷阱,它无法正确显示链接(ID错误)

http://127.0.0.1:8000/job_seeker.verification/ 1566934249 ?signature = a70c7846941347109945c2e9d07ccbcd285082e3b1f561d15e4b86d3afceb467

以粗体显示的区域应该是正确的ID

https://github.com/moussa03/job_board

这是整个项目的链接,以防万一有人希望看看它的任何帮助将不胜感激

我已经尝试过以下解决方案 Apply Laravel 5.7 MustVerifyEmail on Multiple Authentication System

整个项目都存在于github

没有错误消息弹出,只是havin issu并通过验证链接选择了新用户ID

1 个答案:

答案 0 :(得分:0)

$company = new Company;
    if($request->input('website') != ""){
        $company->website = $request->input('website');
    }
    $company->name = $request->input('name');
    $company->type = $request->input('type');
    $company->city = $request->input('city');
    $company->phone = $request->input('phone');
    $company->varificationcode = sha1(time());
    $company->profile_description = "No description";
    $company->user_id = $user->id;
    $company->save();

    Mail::to($request->input('email'))->send(new VarifyMail($company));

在电子邮件模板中,我已经访问了公司数据,如下所示:

  <h2 id="greet">Welcome {{$user->name}} to MyCompany</h2>
  <br/>
  <p class="lead">Thank you for registering to our website. It's an honor to have you in our community.</p>
  <br/>
  <p class="lead">Your account has been successfully created. in order to be able to login for the first time, click the link below to activate your account.</p>
  <br/>
  <a class="btn btn-sucess pl-5 pr-5" href="{{url('company/verify',[$user->id ,$user->varificationcode])}}">Verify Email</a>