Laravel:登录系统的学习问题

我正尝试登录进行学习,所以我按照相同的编码跟随了youtube的视频。它应该能够检查输入数据的格式,检查用户是否已经登录,检查用户是否在没有登录的情况下访问下一页,但是最后,即使我已经输入了密码和密码,也始终会显示错误信息输入正确的输入。请帮忙。这是我的代码。

web.php

<?php

  use Illuminate\Support\Facades\Route;

  Route::get('/main', 'MainController@index');

  Route::post('/main/checklogin', 'MainController@checklogin');

  Route::get('main/successlogin', 'MainController@successlogin');

  Route::get('main/logout', 'MainController@logout');

login.blade.php

<!DOCTYPE html>
<html>
<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <title>Login</title>

   <!--CSS-->
   <link rel="stylesheet" href="{{ asset('css/styles.css') }}" type="text/css">
   <link rel="stylesheet" href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' />
   <script type="text/javascript" src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'></script>
</head>
<body>
   <div class="login-page-frame">
      <div class="header-login-page-frame">
        <h3>Login</h3>
      </div>
      <div class="inner-login-form-frame">
           @if(isset(Auth::user()->email))
               <script>window.location="/main/successlogin";</script>
           @endif

           @if($message = Session::get('error'))
               <div class="alert alert-danger alert-block">
                  <button type="button" class="close" data-dismiss="alert"></button>
                  <strong>{{$message}}</strong>
               </div>
           @endif
           @if(count($errors) > 0)
              <div class="alert alert-danger">
                  <ul>
                    @foreach($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
              </div>
           @endif
           <form method="post" action="{{ url('/main/checklogin') }}" class="login-form">
               {{ csrf_field() }}
               <input type="email" placeholder="email" name="login-email" class="form-control">
               <br>
               <input type="password" placeholder="pass" name="login-password" class="form-control">
               <br>
               <input type="submit" name="login" class="btn-login" value="login">
           </form>
      </div>
   </div>
 </body>
</html>

halamanUtama.blade.php

<!DOCTYPE html>
<html>
   <head>
      <title>Halaman Utama</title>
   </head>
   <body>
      <div class="container box">
         <h3 align="center">Selamat Datang</h3>
         <br />
         @if(isset(Auth::user()->email))
            <div class="alert alert-danger success-block">
               <strong>Welcome {{ Auth::user()->email }}</strong>
               <br />
               <a href="{{ url('/main/logout/') }}">Logout</a>
            </div>
         else
            <script>window.location="/main";</script>
         @endif
      </div>
   </body>
</html>

MainController.php

<?php

   namespace App\Http\Controllers;

   use Illuminate\Http\Request;
   use Validator;
   use Auth;
   use Input;
   class MainController extends Controller
   {
      //
      function index(){
         return view('login');
      }

      function checklogin(Request $request){
         $this->validate($request, [
            'email' => 'required|email',
            'password' => 'required|alphaNum|min:3'
         ]);

         $user_data=array(
            'email' => $request->get('login-email'),
            'password' => $request->get('login-password')
         );

         if(Auth::attempt($user_data)){
            return redirect('main/successlogin');
         }else{
            return back()->with('error', 'Wrong Login Details');
         }

      }

      function successlogin(){
         return view('halamanUtama');
      }

      function logout(){
         Auth::logout();
         return redirect('main');
      }
   }