Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 这些凭证与我们的记录不符_Mysql_Laravel_Laravel 5_Laravel 6_Laravel 6.2 - Fatal编程技术网

Mysql 这些凭证与我们的记录不符

Mysql 这些凭证与我们的记录不符,mysql,laravel,laravel-5,laravel-6,laravel-6.2,Mysql,Laravel,Laravel 5,Laravel 6,Laravel 6.2,当我尝试登录时,我突然在电子邮件字段中使用了laravel 6 这些凭据与我们的记录不匹配 我已经检查了我的数据库,输入的电子邮件是正确的,我得到这个错误 另外,我搜索了很多关于这个问题的信息,但没有找到任何解决方案 注意:我已经尝试过这个功能,但它也不起作用 public function setPasswordAttribute($password) { $this->attributes['password'] = \Hash::make($password); }

当我尝试登录时,我突然在电子邮件字段中使用了laravel 6

这些凭据与我们的记录不匹配

我已经检查了我的数据库,输入的电子邮件是正确的,我得到这个错误

另外,我搜索了很多关于这个问题的信息,但没有找到任何解决方案

注意:我已经尝试过这个功能,但它也不起作用

    public function setPasswordAttribute($password)
{
    $this->attributes['password'] = \Hash::make($password);
}
登录控制器

<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Login Controller
    |--------------------------------------------------------------------------
    |
    | This controller handles authenticating users for the application and
    | redirecting them to your home screen. The controller uses a trait
    | to conveniently provide its functionality to your applications.
    |
    */

    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = RouteServiceProvider::HOME;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }
}

试试这个
bcrypt

public function setPasswordAttribute($password)
{
  $this->attributes['password'] = bcrypt($password);
}

可能是你的密码不正确,而不是电子邮件不正确。是正确的。你怎么知道的?您是否在
LoginController
check username()函数中运行了
\Hash::check
。它是否返回
用户名
电子邮件
?因为您使用电子邮件进行验证,所以返回值必须是email。因为我昨天使用了密码,并且根本没有更改它@MalkhaziDartsmelidzeLaravel提供了一个身份验证框架,可以自动创建密码哈希。出于某种原因,它还包括
Hash::make()
。即使没有,PHP也提供了
password\u hash
password\u verify
。很少需要直接使用像
bcrypt
这样的函数,在这种情况下当然不需要。