2
我不想在註冊後登錄用戶,但將他們重定向到登錄頁面。到目前爲止,我已經成功地在RegisterController中覆蓋了Register()。成功註冊後顯示消息
public function Register(Request $request)
{
$validator = $this->validator($request->all());
if ($validator->fails()) {
$this->throwValidationException(
$request, $validator
);
}
return redirect('/login')->with('message','Successfully Registered');
}
但成功消息未顯示。當我直接返回視圖:
return view('auth.login')->with('message','Successfully registered');
的消息話題正確地顯示在登錄頁面,但該網址進入/register
這意味着以後我嘗試登錄,它進入登記表呢?這樣做的實際解決方案是什麼?
試圖用路由 –
路由應該沒有問題,它們最終會落在同一個控制器上,如果這是問題,那麼視圖方法就不太可能發揮作用。 – milo526