首页 > 解决方案 > Laravel 无法使用自定义表名和字段登录

问题描述

我正在尝试使用 laravel 登录一个自定义表,该表名为utilisateurs字段courriel作为用户名和motdepasse密码。

if(Auth::attempt(['courriel' => $request->courriel, 'motdepasse' => $request->motdepasse]))
{     
    return redirect()->intended('/dashboard');
}

return redirect('/')->with(['error' => 'Impossible de se connecter avec ces identifiants']);

Auth:attempt() 总是返回 false。字段没问题,我试过很多次了。

提前致谢。

标签: laravelauthentication

解决方案


推荐阅读