doushi4864 2017-11-25 04:09 采纳率: 100%
浏览 103
已采纳

Laravel:$ request-> password中的'密码'是什么?

This question related to article Laravel 5.4: Login with Username or Email. There, it was suggested the next method of custom authentication:

protected function credentials(Request $request){
    $field = filter_var($request->get($this->username()), FILTER_VALIDATE_EMAIL)
        ? $this->username()
        : 'username';

    return [
        $field => $request->get($this->username()),
        'password' => $request->password,
    ];
}

What means '->password' in $request->password? Field's name attribute? What if my password field's name is passoword1, for example?

<input type="password" name="password1" required>
  • 写回答

2条回答 默认 最新

  • douquanqiao6788 2017-11-25 04:25
    关注

    In Laravel 5.4 you can get input from the $request using

    $request->input('password')

    for input like

    <input type='text' name='password'>

    For your example with name="password1" you would use $request->input('password1').

    Here are some helpful documentation links :)

    https://laravel.com/docs/5.4/requests

    https://laravel.com/api/5.4/Illuminate/Http/Request.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料