title: Laravel 7 authentication attempt
body: <p>From Laravel 7.x documentation, I'm trying to create a manual authentication for my application. The documentation shows as following:</p>
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Auth;
  
  class LoginController extends Controller
  {
      public function authenticate(Request $request)
      {
          $credentials = $request-&gt;only('email', 'password');
  
          if (Auth::attempt($credentials)) {
              // Authentication passed...
              return redirect()-&gt;intended('dashboard');
          }
      }
  }
  </code></pre>
  <p>I have my own user's table:</p>
  <pre><code>sys_users
  ==========
  user_acc character varying(20) NOT NULL, -- Primary Key
  full_name character varying(300) NOT NULL,
  is_suspended boolean DEFAULT FALSE,
  CONSTRAINT PK_SysUsers PRIMARY KEY (user_acc),
  </code></pre>
  <p>To login, the user need to enter the following data:</p>
  <ul>
  <li>Username</li>
  <li>Password</li>
  <li>Module to access</li>
  </ul>
  <p>I tried to customize the controller a bit (not completed yet):</p>
  <pre><code>class LoginController extends Controller
  {
      public function authenticate(Request $request)
      {
          $request-&gt;validate([
              'username' =&gt; 'required',
              'password' =&gt; 'required',
          ]);
          
          $credentials = $request-&gt;only('username', 'password', 'module');
  
          if (Auth::attempt($credentials)) {
              return redirect()-&gt;route($request-&gt;module);
          }
      }
  }
  </code></pre>
  <p>What I want to add to the customized code above is: (i) checking if the username is exist in the table by querying the <code>sys_users</code> table, (ii) checking the password using POP3 (I already prepared the <code>phpmailer</code> library and the code), and (iii) checking if the user has access to those module by querying another table that I had prepared.</p>
  <p>The problem is:</p>
  <ol>
  <li>I don't know <strong>WHERE</strong> to put all of that code. If possible, I wanted to put them inside the <code>Auth</code> class' <code>attempt</code> method, but I can't seem to find the supposed method. The documentation is very lacking and did not provide a detailed explanation.</li>
  <li><strong>IF</strong> somehow it is impossible to modify the <code>attempt</code> method in <code>Auth</code> class, how should I proceed with the authentication process?</li>
  </ol>