php - 使用 laravel 5.7 进行电子邮件验证
问题描述
所以我在 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 时不会弹出错误消息
解决方案
$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>
推荐阅读
- xamarin - TableView SectionIndexTitles 边距
- php - PHP foreach 语句
- mysql - mysql:将 varchar 特定格式日期转换为 DATETIME
- python - 参数和函数调用
- visual-studio-code - 如何为 VSCode 的输出面板添加自定义着色
- c# - ASP.NET Core 2.2 User.Identity 在剃刀中有一个值,但在控制器中没有
- mysql - 使用 TestContainers 时 @Transactional 不回滚
- code-coverage - coveralls.io(或任何其他):生成文件的覆盖范围(不在 git 中)
- azure - 将 Azure 订阅 - MSDN 转移到 MSDN
- c# - 如何在 Roslyn 中将给定的语句字符串解析为 StatementSyntax?