在我的数据库中,我有两个字段,如" userName"," loginName" 但是" loginName"默认情况下总是" NULL"
我想让用户使用" userName"或" loginName" (loginName可以由用户在将来/系统生成的userName中设置)
c
答案 0 :(得分:0)
a=(char*)malloc( 100*sizeof(char) );
答案 1 :(得分:0)
$data = [];
if ($request->userName) {
$data['userName'] = $request->userName;
}
if ($request->loginName) {
$data['loginName'] = $request->loginName;
}
$data['password'] = $request->passHash;
if (Auth::attempt($data)) {
// Do something
}