我想更改Laravel Auth的默认密码字段名称,这是因为即时通讯使用ORACLE,我该如何更改?我试过这个,但我无法登录
user.php的
protected $table = 'SEG_USUARIOS1';
public function getAuthPassword()
{
return $this->contrasenha;
}
RegisterController.php
protected function validator(array $data)
{
return Validator::make($data, [
'email' => 'required|string|email|max:255|unique:SEG_USUARIOS1',
'contrasenha' => 'required|string|min:6|confirmed',
]);
}
protected function create(array $data)
{
$user = User::create([
'nombre' => $data['name'],
'email' => $data['email'],
'contrasenha' => bcrypt($data['password']),
'verifytoken' => Str::random(40),
]);
$thisUser = User::findOrFail($user->usuario_id);
$this->sendEmail($thisUser);
return $user;
}
我正在使用laravel 5.4
答案 0 :(得分:0)
我的代码还可以,唯一的问题是我使用了另一个主键,
所以你必须在User.php
protected $primaryKey = 'your_id';