$input=[
'mail' = > Input::get('mail'),
'password' = > Input::get('password'),
];
if(Auth::attempt($input)){
echo 'Success';
} else{
echo 'Failed';
}
Unable to authenticate
Below is User.php. Where else should I look?
<?php
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemovableInterface;
class User extensions Eloquent implements UserInterface, RemovableInterface {
protected$table='users';
public function getAuthIdentifier(){
return$this->getKey();
}
public function getRememberToken(){
return$this->remember_token;
}
public function getAuthPassword(){
return $this->password;
}
public function setRememberToken($value){
$this->remember_token=$value;
}
public function getRememberTokenName(){
return 'remember_token';
}
public function getReminderEmail(){
return$this->email;
}
}
$input=[
'email' = > Input::get('mail'),
'password' = > Input::get('password'),
];
Please change mail
to email
as above code.
You may also need to verify that the password column in the database is at least 60 characters long.
Please hash your password when you register.Do not hash during authentication
$user->password=Hash::make(Input::get('password'));
© 2024 OneMinuteCode. All rights reserved.