resources/lang/ja.json を以下の内容で作成するだけでメッセージが日本語になります。
{
"Login":"ログイン",
"E-Mail Address":"メールアドレス",
"Password":"パスワード",
"Remember Me":"ログイン状態を保存する",
"Forgot Your Password?":"パスワードをお忘れですか ?",
"Register":"登録",
"Name":"お名前",
"Confirm Password":"パスワード(確認用)",
"Reset Password":"パスワードリセット",
"Send Password Reset Link":"パスワードリセットリンク送信",
"Logout":"ログアウト",
"Verify Your Email Address":"ユーザ登録を完了してください",
"A fresh verification link has been sent to your email address.":"新しいリンクをあなたのメールアドレスに送信しました。",
"Before proceeding, please check your email for a verification link.":"メールに記載されているリンクをクリックして登録手続きを完了してください。",
"If you did not receive the email":"もしメールが届いていない場合は",
"click here to request another":"こちらをクリックして確認メールを再送信してください",
"Please click the link below to verify your email address.":"メールアドレスを確認するために下のリンクをクリックしてください。",
"Verify Email Address":"メールアドレス確認",
"If you did not create an account, no further action is required.":"心当たりがない場合は、本メッセージは破棄してください。",
"Click button below and reset password.":"下のボタンをクリックしてパスワードを再設定してください。",
"Reset password":"パスワードリセット",
"If you did not request a password reset, no further action is required.":"心当たりがない場合は、本メッセージは破棄してください。"
}
https://qiita.com/nekyo/items/eba7f145a71a5d04b57d
https://github.com/caouecs/Laravel-lang/tree/master/src/ja
https://github.com/caouecs/Laravel-lang
'locale' => 'en',
↓
'locale' => 'ja',
'timezone' => 'UTC',
↓
'timezone' => 'Asia/Tokyo',
以上です。
php artisan vendor:publish --tag=laravel-mail
php artisan vendor:publish --tag=laravel-notifications
コマンドを実行すると
resources/views/vendor/mail/(複数のテンプレートファイル)
resources/views/vendor/notifications/email.blade.php
ファイルが自動生成されます。 変更する箇所は次の画像の通りです。
↓ すべて日本語化すると次のようになります
app/Http/Middleware/RedirectIfNotUser.php
public function handle($request, Closure $next, $guard = 'user')
{
if (!Auth::guard($guard)->check()) {
return redirect('user/login'); // ここを書き換えます
}