laravel 用户登录校验问题

为什么校验不通过 是不是md5有问题
Auth::attempt(array('email'=>Input::get('email'), 'password'=>Input::get('password')))
注册的时候密码使用
$user->password =Hash::make(Input::get('password'));
生成的密码
已邀请:

FiveSay - 成武

赞同来自:

请检查一下 User 模型是否已经正确实现了这个接口 Illuminate\Auth\UserInterface
默认的实现方式请参考 https://github.com/5-say/larav ... r.php

skybody

赞同来自:

还是校验不通过

skybody

赞同来自:

<?php

use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;

class User extends Eloquent implements UserInterface, RemindableInterface {

public static $rules = array(
'username'=>'required|alpha|min:2',

'email'=>'required|email|unique:user',
'password'=>'required|between:3,12',

);

/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'user';

/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array('password');

/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}

/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{

return $this->password;
}

/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken()
{
return $this->remember_token;
}

/**
* Set the token value for the "remember me" session.
*
* @param string $value
* @return void
*/
public function setRememberToken($value)
{
$this->remember_token = $value;
}

/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName()
{
return 'remember_token';
}

/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}

}

FiveSay - 成武

赞同来自:

你所提供的 User 模型,也没看出来有什么问题。
如果仅仅是验证失败的话,有没有可能是 email 的问题呢。

skybody

赞同来自:

谢谢已经搞定了,主要是model问题

要回复问题请先登录注册