Session Hash::check()可以工作,但Auth::尝试失败(自定义用户模型)

Session Hash::check()可以工作,但Auth::尝试失败(自定义用户模型),session,authentication,laravel,login,login-attempts,Session,Authentication,Laravel,Login,Login Attempts,我正在学习Laravel4,但现在我无法将用户登录到我的应用程序。 我阅读了多个教程来创建日志区域,但我无法创建会话 解决方案: 您必须小心使用“password”索引,无论您的表如何命名password字段,它都必须是Auth::trust函数中的“password” 用户数据库表: 伊杜萨里奥,国际(11) 登录,varchar(45) 诺姆布雷,瓦查尔(45) 康塔塞纳,瓦查尔(255) 地位,布尔 记住你的令牌,varchar(100) idperfil,int(11) 这是我的自

我正在学习Laravel4,但现在我无法将用户登录到我的应用程序。 我阅读了多个教程来创建日志区域,但我无法创建会话

解决方案:

您必须小心使用“password”索引,无论您的表如何命名password字段,它都必须是Auth::trust函数中的“password”

用户数据库表:

  • 伊杜萨里奥,国际(11)
  • 登录,varchar(45)
  • 诺姆布雷,瓦查尔(45)
  • 康塔塞纳,瓦查尔(255)
  • 地位,布尔
  • 记住你的令牌,varchar(100)
  • idperfil,int(11)
这是我的自动诱惑功能:

Route::post('login',function())
{
if(Auth::trunt(['login'=>Input::get('login'),'contrasena'=>Input::get('password')))
返回重定向::预期的('home');
return Redirect::to('login')->带有('response','ingresponse');
}
我的自定义用户模型:

使用lightlight\Auth\UserTrait;
使用Illumb\Auth\UserInterface;
使用Illumb\Auth\Members\MemberableTrait;
使用Illumb\Auth\Employers\EmployableInterface;
类Usuario扩展了Elountit实现了UserInterface、RemembrableInterface{
受保护的$table='usuario';
受保护的$hidden=数组('contrasena');
受保护的$fillable=数组('login','nombre','status','idperfil');
受保护的$guarded=array('idusuario','contrasena');
public$primaryKey='idusuario';
public$timestamps=false;
公共函数getAuthIdentifier()
{
返回$this->login;
}
公共函数getAuthPassword()
{
返回$this->contrasena;
}
公共函数getMemberToken()
{
返回$this->记住\u令牌;
}
公共函数setMemberToken($value)
{
$this->memory_token=$value;
}
公共函数getMemberTokenName()
{
返回“记住令牌”;
}
公共函数getRememberEmail()
{
返回false;
}
我的看法是:

{{Form::open(数组('url'=>'login','role'=>'Form'))}
{{$response或''}}
乌萨里奥
康瑟斯尼娜
伊尼西亚·塞西翁
我一直在测试

dd(Auth::trunt(['login'=>Input::get('login'),'contrasena'=>Input::get('password')));
但我无法修复它,但当我测试哈希检查以验证密码时,它返回true! 有什么想法吗?
提前谢谢!

对不起,我没有读到Jarek Tkaczyk的第2行答案。
如果您有相同的问题,请务必查看索引名。

在发布之前,请复制我找到的并测试该发布解决方案,但它不起作用。这是it mate,但请确保您的操作与链接答案中的操作完全相同。否则,请粘贴您尝试的代码。可能重复