【问题标题】:email verification with laravel 5.7使用 laravel 5.7 进行电子邮件验证
【发布时间】:2019-08-27 18:54:00
【问题描述】:

所以我在尝试构建验证电子邮件脚本时遇到了 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中

使用验证链接选择新用户 ID 时不会弹出错误消息

【问题讨论】:

  • 尝试从您的路线中删除这一行:Auth::routes(['verify' => true]);,否则我认为您的验证路线会被覆盖
  • 不,它不工作

标签: php laravel


【解决方案1】:
$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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-03-05
    • 2019-02-21
    • 2019-03-05
    • 2023-03-28
    • 2019-03-04
    • 2019-03-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多