Laravel 认证模块 login 输入用户名密码后 登陆失败 返回 login 页面。

采用laravel的认证模块来进行用户注册和登陆。
目前注册可用。 mysql里有数据。
但是在登陆(login)的时候失败。返回登录页面。
请教各位大侠怎么解决。
目前的登陆不成功,所以获取认证用户信息Auth::user()都是NULL
下面是我的代码:

Route::group(['middleware' => ['web']], function () {
  //认证路由
  Route::get('auth/login','Auth\AuthController@getLogin');
  Route::post('auth/login','Auth\AuthController@postLogin');
  Route::get('auth/logout','Auth\AuthController@getLogout');
  //注册路由
  Route::get('auth/register','Auth\AuthController@getRegister');
  Route::post('auth/register','Auth\AuthController@postRegister');

});
<?php

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
{
    /*
    |--------------------------------------------------------------------------
    | Registration & Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles the registration of new users, as well as the
    | authentication of existing users. By default, this controller uses
    | a simple trait to add these behaviors. Why don't you explore it?
    |
    */

    use AuthenticatesAndRegistersUsers, ThrottlesLogins;

    /**
     * Where to redirect users after login / registration.
     *
     * @var string
     */
    protected $redirectTo = '/photo';

    /**
     * Create a new authentication controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware($this->guestMiddleware(), ['except' => 'logout']);
    }

    /**
     * Get a validator for an incoming registration request.
     *
     * @param  array  $data
     * @return \Illuminate\Contracts\Validation\Validator
     */
    protected function validator(array $data)
    {
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'password' => 'required|min:6|confirmed',
        ]);
    }

    /**
     * Create a new user instance after a valid registration.
     *
     * @param  array  $data
     * @return User
     */
    protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);
    }
}

注册页面

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    {{Form::open([
      'url'=>'/auth/register',
      'method'=>'POST'
      ])}}
      {!! csrf_field() !!}

   <div>
       Name
       <input type="text" name="name" value="{{ old('name') }}">
   </div>

   <div>
       Email
       <input type="email" name="email" value="{{ old('email') }}">
   </div>

   <div>
       Password
       <input type="password" name="password">
   </div>

   <div>
       Confirm Password
       <input type="password" name="password_confirmation">
   </div>

   <div>
       <button type="submit">Register</button>
   </div>

    {{ Form::close() }}
  </body>
</html>

登录页面

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    {{ Form::open([
      'url'=>'/auth/login',
      'method'=>'POST'
      ]) }}
      {{ csrf_field() }}
      <div>
        Email:
        <input type="email" name="name" value="{{ old('email') }}">
      </div>
      <div>
        Password:
        <input type="password" name="password" id="password"/>
      </div>
      <div>
        <input type="checkbox" name="remember">Remember Me
      </div>
      <div>
        <button type="submit">Login</button>
      </div>
    {{Form::close()}}
  </body>
</html>

补充: 版本:5.2 没有报错信息。 只是又跳转回登录页面。

《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
《L05 电商实战》
从零开发一个电商项目,功能包括电商后台、商品 & SKU 管理、购物车、订单管理、支付宝支付、微信支付、订单退款流程、优惠券等
讨论数量: 11
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!