I have laravel 5.2 project and need to add Authentication, but I need to connect it to my table, that has Username and Password, also change default email/password to username/password. Also in my table passwords are not crypted.
I have change login.blade.php file from email field to username.
Also change user.php model:
protected $table = 'LoginTable';
Also change AuthController.php. Add this:
protected $username = 'username';
and change validator and create methods:
return Validator::make($data, [
'username' => 'required|max:255',
'password' => 'required|min:6|confirmed',
]);
return User::create([
'username' => $data['username'],
'password' => bcrypt($data['password']),
]);
But I cant login.It's saying 'These credentials do not match our records.'. How can I check what is the problem? Can anyone help me with this issue?
UPDATE
I have change password to hashed password, but still cant make auth work.It is still saying: These credentials do not match our records.
I want to mention that in Database I have only username and password, and dont have name and email.
authenticatea user. docs