对《Laravel 教程 - Web 开发实战入门 ( Laravel 5.5 ) 》一书中关于邮箱问题?
首先非常喜欢此书。
在按照书中带码操作时遇到:
php artisan make:notification ResetPassword
app/Notifications/ResetPassword.php
<?php
namespace App\Notifications;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class ResetPassword extends Notification
{
public $token;
public function __construct ($token)
{
$this->token = $token;
}
public function via ($notifiable)
{
return ['mail'];
}
public function toMail($notifiable)
{
return (new MailMessage)
->line('这里可以放我们需要添加的内容')
->line('You are receiving this email because we received a password reset request for your account')
->action('重置密码' , url(route('password.reset' , $this->token , false)))
->line('这里可以放我们需要添加的内容')
->line('If you did not request a password reset, no further action is required.');
}
}
但是发送的邮件确实纯英文的(冒失我的类就没起作用)
app/Models/User.php
<?php
namespace App\Models;
use App\Models\User;
use App\Notifications\ResetPassword;
use Illuminate\Http\Request;
use Mail;
use Auth;
class User extends Authenticatable
{
.
.
.
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPassword($token));
}
}
很是奇怪,请问这种问题,遇到该如何解决,或者说我该从什么地方着手,希望论坛中大手给个思路
推荐文章: