if(count($data) == 1)
{
return view('home');
}
else {
// echo"ta-da";
Redirect::back()->with('message','username or password not Match!');
}
以上Redirect :: back()函數在登錄時不起作用。 如果我打印的東西,它顯示Redirect :: back()在laravel 5.4中不起作用
if(count($data) == 1)
{
return view('home');
}
else {
// echo"ta-da";
Redirect::back()->with('message','username or password not Match!');
}
以上Redirect :: back()函數在登錄時不起作用。 如果我打印的東西,它顯示Redirect :: back()在laravel 5.4中不起作用
您需要return
重定向
重定向你必須使用laravel內置功能
return redirect()->back()->with('msg_name', 'your message');
,或者您可以使用的路線()方法instate回()方法
return redirect()->route('your.route.name').with('msg_name', 'your message');
感謝saifur rahman,這是工作。感謝您的支持。 –
使用回報重定向重定向到前路線
'返回Redirect :: back() - >('message','username or password not Match!');' – linktoahref