0
這是我的LoginController,我想顯示自定義登錄錯誤消息「Invaild password」。我該怎麼辦?請善意幫助我!提前致謝。登錄錯誤消息Laravel
* -
> <?php namespace App\Http\Controllers\Auth; use
> App\Http\Controllers\Controller; use
> Illuminate\Foundation\Auth\AuthenticatesUsers; use
> Illuminate\Http\Request; class LoginController extends Controller {
> use AuthenticatesUsers;
> /**
> * Where to redirect users after login.
> *
> * @var string
> */
> protected $redirectTo = '/Dashboards';
> /**
> * Create a new controller instance.
> *
> * @return void
> */
> public function __construct()
> {
> $this->middleware('guest', ['except' => 'logout']);
> }
> public function username()
> {
> return 'username';
> }
> /**
> * Log the user out of the application.
> *
> * @param \Illuminate\Http\Request $request
> * @return \Illuminate\Http\Response
> */
> public function logout(Request $request)
> {
> $this->guard()->logout();
> $request->session()->flush();
> $request->session()->regenerate();
> return redirect('/login');
> } }
***
感謝好友超越此功能。但它不工作:( – blackWaterLiLi
消息是英語嗎? –
是的我想顯示我的錯誤消息,如「無效的用戶名和密碼,請再試一次! – blackWaterLiLi