Hi.. i recently changed one of my existing project to Auth. While testing i found out that all my users are not able to log in.
model/User.php
<?php
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
use SoftDeletingTrait;
protected $dates = ['deleted_at'];
protected $hidden = array('password');
protected $table = 'users';
public function role()
{
return $this->belongsTo('Role');
}
}
login function
$input = array(
'email' => Input::get( 'email' ), // login using email
'password' => Input::get( 'password' ),
);
if(Auth::attempt($input))
tried this and both statement return true
// hashed password saved in the DB
$hash = '$2y$08$n6Yt9eeTK33kvfOf/KDkt.CZTCVJkvZo3etbJZsqgN0HVAhhD9LXK';
var_dump(password_verify('123456', $hash));
var_dump(password_verify('123456', Hash::make('123456')));
i have check my users table and the password is Varchar 255
think i fixed the error but adding the following to model/User.php
/**
* 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;
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community