我使用laravel 6突然,当我试图登录时,我在电子邮件字段上。
这些凭据与我们的记录不匹配。
我已经检查了我的数据库,输入的电子邮件是正确的,我收到了这个错误
此外,我搜索了很多关于这个问题的信息,但没有得到任何解决方案
注意:我已经尝试过这个功能,但也不起作用
public function setPasswordAttribute($password)
{
$this->attributes['password'] = Hash::make($password);
}
登录控制器
<?php
namespace AppHttpControllersAuth;
use AppHttpControllersController;
use AppProvidersRouteServiceProvider;
use IlluminateFoundationAuthAuthenticatesUsers;
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);
}