So I'm trying to make an account-based website using Laravel 5.5.
I have a database table 'users' where it has:
id - int(10)[PRIMARY_KEY],
created_at - timestamp,
updated_at - timestamp,
username - varchar [FOREIGN_KEY]
password - varchar
I already have username and password in my database
username: vanderozili
password: jaujaujau
when i'm trying to login using this validation
$validation = Validator::make( $request->all(), [
'username' => 'username|required',
'password' => 'required|min:8'
]);
if(Auth::attempt(['username', $request->input('username'), 'password', $request->input('password')])){
return redirect('/shop');
}
return redirect()->back();
}
I'm encountering this error.
(2/2) QueryException
SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'where clause' (SQL: select * from users
where 0
= username and 1
= vanderozili and 2
= password and 3
= jaujaujau limit 1)
I'm using mysql thru phpmyadmin
I already searched it online but I can't see a similar problem as I'm experiencing. What seems to be the problem?