Support the ongoing development of Laravel.io →
Authentication Input Database
Last updated 2 years ago.
0
$user = User::where('member_number', $member_number)->where('pin', $pin)-first();

Auth::login($user);
0

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 
}
0

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.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

AtomicRSA atomicrsa Joined 24 Jun 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.