title: How to get login with different database table column name in Laravel 5.2?
body: <p>I have to implement login functionality in Laravel 5.2. I have successfully done so using the official Laravel documentation except that I do not know how to authenticate the user using different database table column names, namely <code>st_username</code>and <code>st_password</code>.</p>
  
  <p>I have searched the Internet for clues but to no avail.
  I don't know which class I need to use (like, use Illuminate.......) for Auth.  If any one knows the answer, please let me know. </p>
  
  <p>Here is my code:</p>
  
  <p>Login View</p>
  
  <pre><code>@extends('layouts.app')
  @section('content')
  
  &lt;div class="contact-bg2"&gt;
      &lt;div class="container"&gt;
          &lt;div class="booking"&gt;
              &lt;h3&gt;Login&lt;/h3&gt;
              &lt;div class="col-md-4 booking-form" style="margin: 0 33%;"&gt;
                  &lt;form method="post" action="{{ url('/login') }}"&gt;
                      {!! csrf_field() !!}
  
                      &lt;h5&gt;USERNAME&lt;/h5&gt;
                      &lt;input type="text" name="username" value="abcuser"&gt;
                      &lt;h5&gt;PASSWORD&lt;/h5&gt;
                      &lt;input type="password" name="password" value="abcpass"&gt;
  
                      &lt;input type="submit" value="Login"&gt;
                      &lt;input type="reset" value="Reset"&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  
  
  @endsection
  </code></pre>
  
  <p>AuthController</p>
  
  <pre><code>namespace App\Http\Controllers\Auth;
  
  use App\User;
  use Validator;
  use App\Http\Controllers\Controller;
  use Illuminate\Foundation\Auth\ThrottlesLogins;
  use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
  
  class AuthController extends Controller
  {
      use AuthenticatesAndRegistersUsers, ThrottlesLogins;
  
      protected $redirectTo = '/home';
  
      public function __construct()
      {
          $this-&gt;middleware('guest', ['except' =&gt; 'logout']);
          $this-&gt;username = 'st_username';
          $this-&gt;password = 'st_password';
      }
  
      protected function validator(array $data)
      {
          return Validator::make($data, [
                      'name' =&gt; 'required|max:255',
                      'email' =&gt; 'required|email|max:255|unique:users',
                      'password' =&gt; 'required|confirmed|min:6',
          ]);
      }
  </code></pre>
  
  <p>Route File</p>
  
  <pre><code>Route::get('/', function () {
      return view('index');
  });
  
  Route::group(['middleware' =&gt; 'web'], function () {
      Route::auth();
  
      Route::get('/home', 'HomeController@index');
  });
  </code></pre>
  
  <p>config/auth.php</p>
  
  <pre><code>return [
      'defaults' =&gt; [
          'guard' =&gt; 'web',
          'passwords' =&gt; 'users',
      ],
      'guards' =&gt; [
          'web' =&gt; [
              'driver' =&gt; 'session',
              'provider' =&gt; 'users',
          ],
          'api' =&gt; [
              'driver' =&gt; 'token',
              'provider' =&gt; 'users',
          ],
      ],
      'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; App\User::class,
          ],
  //        'users' =&gt; [
  //            'driver' =&gt; 'database',
  //            'table' =&gt; 'users',
  //        ],
      ],
      'passwords' =&gt; [
          'users' =&gt; [
              'provider' =&gt; 'users',
              'email' =&gt; 'auth.emails.password',
              'table' =&gt; 'password_resets',
              'expire' =&gt; 60,
          ],
      ],
  ];
  </code></pre>