title: Auth::login($user) in laravel not able to login the user
body: <p>I am using <strong>laravel 5.4</strong> and <strong>Auth::login($user)</strong> is showing Type error: </p>
  
  <blockquote>
    <p>Argument 1 passed to Illuminate\Auth\SessionGuard::login() must
    implement interface Illuminate\Contracts\Auth\Authenticatable,
    instance of Illuminate\Database\Eloquent\Builder given, called in
    /home/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on
    line 294</p>
  </blockquote>
  
  <p>My User.php file is:
      
  
  <pre><code>namespace App;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  class User extends Authenticatable
  {
  use Notifiable;
  /**
   * The attributes that are mass assignable.
   *
   * @var array
   */
  protected $fillable = [
      'name', 'email', 'role', 'password',
  ];
  
  /**
   * The attributes that should be hidden for arrays.
   *
   * @var array
   */
  protected $hidden = [
      'password', 'remember_token',
  ];
  }
  </code></pre>
  
  <p>My AuthController.php is:
  
  
  <pre><code>namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\User;
  use Auth;
  use Illuminate\Support\Facades\Input;
  use \Hash;
  
  class AuthController extends Controller
  {
  //
  public function register(Request $request){
      $this-&gt;validate($request, [
          'name' =&gt; 'required|max:30',
          'email' =&gt; 'required|email|unique:users',
          'regpassword' =&gt; 'required|alpha_num|confirmed'
          ]);
  
      /*$user = new User();
      $user['name'] = $request['name'];
      $user['email'] = $request['email'];
      $user['password'] = bcrypt($request['password']);
      $user['role'] = 'user';
      $user-&gt;save();
      */
      $user = User::create(array(
          'email' =&gt; Input::get('email'),
          'name' =&gt; Input::get('name'),
          'password' =&gt; Hash::make(Input::get('password')),
          'role' =&gt; 'user'));
      return 'success';
  
  
   }
  
  public function userLogin(Request $request){
      $this-&gt;validate($request,[
          'email' =&gt; 'required|email',
          'password' =&gt; 'required' 
          ]);
  
      $user = User::where('email', '=', $request['email'])-&gt; where('password' ,'=', Hash::make($request['password']))-&gt;where('role','=','user');                                                    
  
      if($user){
          Auth::login($user); 
          return $next($request);
      }
      else{
          return redirect()-&gt;back();
      }
  
  
  }
  }
  </code></pre>
  
  <p>My web.php</p>
  
  <pre><code>Route::get('/', function () {
  return view('welcome');
  });
  
  Auth::routes();
  
  Route::get('/home', 'HomeController@index');
  Route::post('/register', 'AuthController@register');
  Route::post('/UserLogin','AuthController@userLogin');
  </code></pre>