Php Auth:trument()不起作用。laravel 5

Php Auth:trument()不起作用。laravel 5,php,laravel,Php,Laravel,我的Auth::trunt()函数不起作用。它总是将我重定向到日志页面,即使电子邮件和密码正确 这是我的控制器: namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Requests\UserRequest; use App\Http\Controllers\Controller; use App\User; use Auth; class Users

我的
Auth::trunt()
函数不起作用。它总是将我重定向到日志页面,即使电子邮件和密码正确

这是我的控制器:
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Requests\UserRequest;
use App\Http\Controllers\Controller;
use App\User;
use Auth;

class UsersController extends Controller
{
    public function getNewaccount(){
        return view('users.newaccount');
    }

    public function postCreate(Request $request){
        $user=new User($request->all());
        $user->save();
        return redirect('users/signin')->with('message','Thank you for registering please sign in');
    }

    public function getSignin(){
        return view('users.signin');
    }

    public function postSignin(Request $request){
        if(Auth::attempt(array('email'=>$request->input('email'),'password'=>$request->input('password')))){
            return redirect('/')->with('message','Thanks for signing');
        }else{
            return redirect('users/signin')->with('message','Email/password are wrong');
        }
    }

    public function getSignout(){
        Auth::logout();
        return redirect('users/signin')->with('message','You have successfully logged out');
    }
}
这是我的签到表:

@extends('layouts.main')

@section('content')

    <section id="signin-form">
        <h1>I have an account</h1>
        {!! Form::open(array('action'=>'UsersController@postSignin')) !!}
        <p>
            {!! Html::image('img/email.gif', 'Email Address') !!}
            {!! Form::text('email') !!}
        </p>
        <p>
            {!! Html::image('img/password.gif', 'Password') !!}
            {!! Form::password('password') !!}
        </p>

        {!! Form::submit('Sign In', array('class'=>'secondary-cart-btn')) !!}
        {!! Form::close() !!}
    </section><!-- end signin-form -->
    <section id="signup">
        <h2>I'm a new customer</h2>
        <h3>You can create an account in just a few simple steps.<br>
            Click below to begin.</h3>
        <a href='users/newaccount' class='default-btn'>Create New Account</a>

    </section><!--- end signup -->

@stop
@extends('layouts.main'))
@节(“内容”)
我有一个帐户
{!!Form::open(数组('action'=>)UsersController@postSignin')) !!}

{!!Html::image('img/email.gif','email Address')!!}
{!!Form::text('email')!!}

{!!Html::image('img/password.gif','password') {!!Form::password('password')!!}

{!!表单::提交('Sign-In',array('class'=>'secondary-cart-btn')) {!!Form::close()!!} 我是新顾客 您只需几个简单的步骤即可创建帐户。
单击下面开始。 @停止
你能发布你的路线吗?你如何知道你的密码和电子邮件是正确的?我的意思是在config dir中的
auth.php
中,检查您的模型名称是否正确,同时检查db中的密码是否为hash这是我的路由文件:这是我的路由文件:
public function postSignin(Request $request)
    {
 //if you require validation otherwise you can skip this step
        $vLogin = validator::make($request->all(), [
            'email' => 'required|email',
            'password' => 'required'
        ]);

        if ($vLogin->fails()) {
            return redirect()->back()
                ->withErrors($vLogin->errors())
                ->withInput(Input::except('password'));
        } else {
            /*
             *getting the email and password that user has typed in form
             */
            $loginData = array(
                'email' => Input::get('email'),
                'password' => Input::get('password')
            );

            /*
             * Checking against the record in database whether the email and password is valid
             * Or the record exists in the database
             */
            if (Auth::validate($loginData)) {
                if (Auth::attempt($loginData)) {
                    //return wherever you like
                    return Redirect::intended('dashboard');
                }
            } else {
                // if any error send back with message.
                Session::flash('error', 'Invalid Email/Password Combination');
                return Redirect::to('login');
            }
        }
    }