2016-11-15 84 views
1

我想翻譯郵件中的消息。在laravel中更改密碼重置郵件消息

vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php

public function toMail() 
{ 
    return (new MailMessage) 
     ->line([ 
      'You are receiving this email because we received a password reset request for your account.', 
      'Click the button below to reset your password:', 
     ]) 
     ->action('Reset Password', url('password/reset', $this->token)) 
     ->line('If you did not request a password reset, no further action is required.'); 
} 

什麼是改變信息的最佳方式?肯定我不應該在這個文件中改變它..

回答

2

5.3 docs

你可以很容易修改用於發送密碼重置鏈接給用戶的通知類。要開始使用,請在用戶模型上覆蓋sendPasswordResetNotification方法。在此方法中,您可以使用您選擇的任何通知類發送通知。密碼重置$令牌是由該方法獲得的第一個參數:

public function sendPasswordResetNotification($token) 
{ 
    $this->notify(new ResetPasswordNotification($token)); 
} 

希望這有助於。

0

Localization in doc起,語言字符串存儲在resources/lang目錄中的文件中。 創建例如messages.php

<?php 

return [ 
    'welcome' => 'Welcome to our application' 
]; 

並使用trans函數。

echo trans('messages.welcome');