$user = User::where('member_number', $member_number)->where('pin', $pin)-first();
Auth::login($user);
The Auth::attempt
method can already do that for you.
if (Auth::attempt(['member_number' => $member_number, 'pin' => $pin])) {
// Credentials pass and Laravel will log the user in
}
Thank you both for your replies, I am new to laravel and i do not have a clue where i must use that. Must i add the fields to the user table? do i create another table?
Currently the login uses mail and password. I need to keep that for admin then i need to have a login where they will only use the member number and the pin. This will show different menu's and functions than admin. I do not have a problem (yet) with the other menu's and functions, it is just the login that i do not know how to handle because i need to authenticate them to know with who i am working with do do certain things.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community