0

I want to authenticate a user based upon the credentials which is in one database and date of birth which is in another database. I have searched for customization but what i just found is, customization using only one database and its table. Wasn't of much help to me

1 Answer 1

1

You can query the two databases manually and then log in the user yourself.

For example:

$user = User::where(['email' => $email, 'password' => $password])->first();
$userSecondDb = UserSecondDb::where(['id' => $user->id, 'dateofbirth' => $dateofbirth])->first();
if (isset($user) && isset($userSecondDb))
{
    Auth::login($user);
}
Sign up to request clarification or add additional context in comments.

2 Comments

I am a newbee to laravel, Auth::login($user) does it mean defining a function login in the Auth. And another question is after login i want to hide or display menu partial views based upon user privilege value. for example: if privilege = 3 display all and if privilege = 0 just display basic menu!!!!! @ Jerodev
And another thing do i need to do php artisan make:auth for this? I am not using it though. I am manually doing it. Please enlighten me!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.