Php Laravel 5.2:Auth::trunt()不起作用

Php Laravel 5.2:Auth::trunt()不起作用,php,authentication,laravel-5.2,Php,Authentication,Laravel 5.2,今晚我在Laravel5.2中尝试了Auth::trunt。 我已经读过一些案例,但它根本不能解决我的问题 这是我的doLogin函数: public function doLogin(LoginRequest $request) { $customer = [ 'email' => $request->input('email'), 'password' => $request->input('password')

今晚我在Laravel5.2中尝试了
Auth::trunt
。 我已经读过一些案例,但它根本不能解决我的问题

这是我的doLogin函数:

public function doLogin(LoginRequest $request)
{   
    $customer = [
        'email' => $request->input('email'),
        'password' => $request->input('password') 
    ];
    if (Customer::where('email', '=', $request->input('email'))->exists()) {
        if (Auth::attempt($customer)) { 
            print_r(Auth::user());exit();
        } else {
            return response()->json([
                'error' => true,
                'status_code' => 400,
                'message' => 'Wrong Credential, Please check your email or password'
            ]);     
        }
    } else {
        return response()->json([
            'error' => true,
            'status_code' => 404,
            'message' => 'email not found'
        ]);
    }    
}
我已经在使用
bcrypt()
对数据库中存储的密码进行哈希运算,我的数据库中有密码字段

另外,我已经更改了
$primaryKey='customer_id'


但是结果总是返回
false
(错误的凭证),我写错了什么吗?

您使用了Laravel内置的密码哈希facade还是
bcrypt()
helper函数?另外,您是否收到了
未找到的电子邮件
错误或
错误的凭据
错误?是的,我已经尝试了bcrypt和Make::Hash,但我总是收到错误的凭据..如果您
dd(bcrypt($request->input('password'))
您是否得到了与DB中相同的值?我已经在用户模型中定义了$table,您是否使用了Laravel内置的密码哈希facade或
bcrypt()
helper函数?另外,您是否收到了
未找到的电子邮件
错误或
错误的凭据
错误?是的,我已经尝试了bcrypt和Make::Hash,但我总是收到错误的凭据..如果您
dd(bcrypt($request->input('password'))
您是否得到了与DB中相同的值?我已经在用户模型中定义了$table,