Php laravel 6中的自定义邮件验证模板
我想用自定义html模板自定义默认的laravel电子邮件验证消息,我尝试了不同的解决方案,但要么只在laravel 5中工作,要么验证按钮不工作, 我遵循了本教程: 我的验证方法:Php laravel 6中的自定义邮件验证模板,php,laravel,Php,Laravel,我想用自定义html模板自定义默认的laravel电子邮件验证消息,我尝试了不同的解决方案,但要么只在laravel 5中工作,要么验证按钮不工作, 我遵循了本教程: 我的验证方法: public function verify(Request $request) { $userID = $request['id']; $user = User::findOrFail($userID); $date = date("Y-m-d g:i:s"); $use
public function verify(Request $request)
{
$userID = $request['id'];
$user = User::findOrFail($userID);
$date = date("Y-m-d g:i:s");
$user->email_verified_at = $date; // to enable the “email_verified_at field of that user be a current time stamp by mimicing the must verify email feature
$user->save();
return response()->json("Email verified!");
}
验证通知类:
class VerifyApiEmail extends VerifyEmailBase{
protected function verificationUrl($notifiable)
{
return URL::temporarySignedRoute(
'verificationapi.verify', Carbon::now()->addMinutes(60), ['id' => $notifiable->getKey()]
); // this will basically mimic the email endpoint with get request
}}
在make:auth之后的早期版本Laravel6.0中,您将在
resources/views/auth/verify.blade.php中看到电子邮件模板
使用Laravel 6.0
来自changelog
通常随Laravel早期版本提供的前端支架已提取到Laravel/ui Composer包中
所以首先安装laravel ui和ui:install
composer require laravel/ui "^1.2" --dev
php artisan ui:auth
发布通知和邮件资源:
php artisan vendor:publish --tag=laravel-notifications
php artisan vendor:publish --tag=laravel-mail
并使用自定义模板编辑resources/views/notifications/email.blade.php您是否遵循了?中的说明,但resources/views/auth/verify.blade.php文件是用于电子邮件验证页面的,我想自定义电子邮件中的模板我做到了,但是resources/views/auth/verify.blade.php文件用于电子邮件验证页面,我想在电子邮件消息中自定义模板