前提・実現したいこと
ログインに失敗した際、エラーメッセージをuserテーブルのstatus
(標準から追加した、
仮会員登録済であれば0、本会員であれば1、仮会員登録後メール認証済であれば2、退会済であれば9を
登録する項目です。)
ごとに変えたいです。
発生している問題・エラーメッセージ
LoginControllerにて下記の通り上書き処理を記載しています。
protected function sendFailedLoginResponse(Request $request) { $user = User::where('email', $request->email)->first(); if($user->status == 0 or 2){ throw ValidationException::withMessages([ $this->username() => [trans('auth.failed_provisional')], ]); }elseif($user->status == 9){ throw ValidationException::withMessages([ $this->username() => [trans('auth.failed_quit')], ]); }else{ throw ValidationException::withMessages([ $this->username() => [trans('auth.failed')], ]); } }
その上で、
エラーメッセージファイルは下記の通り記載していますが、
Use of undefined constant register - assumed 'register'
というエラーがでてしまいます。
「{{url(/register/verify/.$token)}}',」
の記載が誤っているのかと思いますが、
どのように記載すればよいでしょうか。
<?php return [ /* |-------------------------------------------------------------------------- | Authentication Language Lines |-------------------------------------------------------------------------- | | The following language lines are used during authentication for various | messages that we need to display to the user. You are free to modify | these language lines according to your application's requirements. | */ 'failed' => '認証情報と一致するレコードがありません。', 'failed_provisional' => '該当のユーザーは仮登録の状態です。<br> 下記URLから本登録が可能です。<br> {{url(/register/verify/.$token)}}', 'failed_quit' => '既に退会したユーザーです', 'throttle' => 'ログインの試行回数が多すぎます。:seconds 秒後にお試しください。', ];
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。