title: Is there any way to authenticate user from two columns which are in seperate table using laravel?
body: <p>I have a flow in which I am authenticating user based on provided <code>email</code> and <code>provider_id</code> (for social sign-in). Right now I have column <code>provider_id</code> in the same table <code>users</code>. Following script is working fine to authenticate the user.</p>
  
  <pre><code>$loginAttempt = User::where([
      ['provider_id', '=', $request-&gt;provider_id],
      ['email', '=', $request-&gt;email]
  ])-&gt;first();
  if($loginAttempt !== null){
      Auth::login($loginAttempt);
      if (!Auth::check()){
          ...
      }else{
          ...
      }
  }
  </code></pre>
  
  <p>But in this way I am unable to store multiple social logins for an user. I am going to split into two tables. The second one is <code>social_login</code> in which I added two columns <code>user_id</code> and <code>provider_id</code>.</p>
  
  <p>Now I want to authenticate user based on <code>email</code> and <code>provider_id</code> but now these are in two different tables. I tried same script with small changes but it does not working. </p>
  
  <p>Can someone kindly guide me about it, how can I do it. I would really appreciate. </p>
  
  <p>Thank you so much. </p>