duandou2763 2016-10-27 09:16
浏览 23
已采纳

Laravel的Hash缺少论点?

I'm getting a weird error in Laravel 5.3's hash mechanism.

Missing argument 2 for Illuminate\Hashing\BcryptHasher::check(), called in C:\xampp\htdocs\Missionseek2\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 237 and defined

This is the code that defines it.

public function postSignIn(Request $request){

        $val = DB::table('ministry')->where('Username', Input::get('Username'))->first();

        if ($val && Hash::check(Input::get('Password', $val->Password))) {
            return redirect()->route('agencydash');
        } return 'failed';
       // if (Auth::attempt(['Username' => $request['Username'], 'Password' => $request['Password']])) {
       //     return redirect()->route('agencydash');
       // }
        //return redirect()->back();
    }

What's going on here? I feel like it's not getting the password value from the database and so we're getting an error, but I'm not sure why. The name's are correct.

  • 写回答

4条回答 默认 最新

  • dqz30992 2016-10-27 09:22
    关注

    You are passing 2 argument in Input::get() instead of check(). You have to correct brackets positions

    if ($val && Hash::check(Input::get('Password'), $val->Password))
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置