【问题标题】:Redirect::back() is not working in laravel 5.2Redirect::back() 在 laravel 5.2 中不起作用
【发布时间】:2017-04-09 19:50:44
【问题描述】:
if(count($data) == 1){
            return view('welcome');
        }
        else {
            // echo "dslkfjads";
            Redirect::back()->with('message','Username or password not Match!'); 
        }

上面的 Redirect::back() 功能在登录时不起作用。如果我正在打印它所显示的任何内容

【问题讨论】:

    标签: php laravel redirect


    【解决方案1】:

    你必须返回一个响应对象,所以你的代码应该是这样的:

    if (count($data) == 1) {
        return view('welcome');
    } else {
        return Redirect::back()->with('message', 'Username or password not Match!');
    }
    

    【讨论】:

      猜你喜欢
      • 2014-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 2015-06-04
      • 2016-08-31
      相关资源
      最近更新 更多