2017-03-16 10 views
1

私はPasswortResetNotificationからメールを翻訳する最良の方法を知りました。ResetPasswordNotificationの翻訳方法

public function toMail($notifiable) 
{ 
    return (new MailMessage) 
     ->line('You are receiving this email because we received a password reset request for your account.') 
     ->action('Reset Password', route('password.reset', $this->token)) 
     ->line('If you did not request a password reset, no further action is required.'); 
} 

これはベンダーフォルダの一部であるため、変更ResetPassword内部コード(上記)、該当しないと思われる - CanResetPassword -traitについて同じ。

私の推測では、私自身のMyResetPasswordNotification(これはResetPasswordNotificationを継承する可能性があります)を作成して、自分のユーザーモデルでsendPasswordResetNotificationのメソッドを上書きする必要があります。

もっと良いアプローチがありますか、私は現在見ていませんか?

+0

:オプションを公開? –

+0

私は現在、最新のものを使用しています - 5.4 – Philipp

答えて

0

あなたがphp artisan vendor:publish使用することができ、これはあなたを与えるだろう

ベンダー設定可能です \resources\views\vendor\notifications:あなたがにしているバージョン

php artisan help vendor:publish 
Usage: 
vendor:publish [--force] [--provider[="..."]] [--tag[="..."]] 

Options: 
--force    Overwrite any existing files. 
--provider   The service provider that has assets you want to publish. 
--tag     The tag that has assets you want to publish. 
--help (-h)   Display this help message 
--quiet (-q)   Do not output any message 
--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug 
--version (-V)  Display this application version 
--ansi    Force ANSI output 
--no-ansi    Disable ANSI output 
--no-interaction (-n) Do not ask any interactive question 
--env     The environment the command should run under. 
+0

何が起こりますか?ベンダーを実行するともう一度公開しますか?これで変更が削除されますか? – Philipp

+0

btw:翻訳したいテキストがブレードテンプレートにないため、公開されたファイルの編集が役に立たなくなります。 – Philipp

+0

正確な部分を翻訳したいですか? –

関連する問題