0
我正在嘗試登錄提供電子郵件和密碼。我嘗試過散列,而不是自己散列密碼。我運行dd(Auth::attempt(Input::except('submit')));
,它返回false。是的,陣列是正確的。是的,這就是數據庫中的內容。我跟着attempt()
到Illuminate/Auth/Guard.php attempt()
該函數的代碼如下。雄辯Auth登錄不起作用
public function attempt(array $credentials = array(), $remember = false, $login = true)
{
$this->fireAttemptEvent($credentials, $remember, $login);
$this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials);
// If an implementation of UserInterface was returned, we'll ask the provider
// to validate the user against the given credentials, and if they are in
// fact valid we'll log the users into the application and return true.
if ($this->hasValidCredentials($user, $credentials))
{
if ($login) $this->login($user, $remember);
return true;
}
return false;
}
該功能根本沒有被修改。 dd($user);
返回正確的信息,用戶的實例具有從數據庫中提取的屬性。和dd($credentials);
返回發佈信息的數組,電子郵件和密碼。
dd($this->hasValidCredentials($user, $credentials));
返回boolean false
。
我不知道爲什麼。讓我知道是否需要更多信息。謝謝!