laravel - 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。字段没问题,我试过很多次了。
提前致谢。
解决方案
推荐阅读
- python - 选择具有 id pyspark 列表的多行
- c++ - 修复视频FPS opencv?
- mysql - 尽管有索引,但 MySQL 的选择查询性能很差
- go - “go build -buildmode=c-shared”编译的dll,如何隐藏导出的goruntime函数?
- swift - 在 alamofire manger 类 swift 中添加公钥固定
- c# - 如何在 CSV 文件中随机生成一个单词
- vuejs2 - 当滚动条在VueJs中到达底部时如何执行功能
- node.js - 使用从另一个模块(node.js)导入的函数
- apache-spark - pyspark 加入两个数据框并按最近日期保留行
- elasticsearch - 我们可以将 char_filter 应用于 elasticsearch 中的自定义标记器吗?