can you try to add this to your model ?
protected $primaryKey = 'email';
also you could try it this way
$credentials = Input::only('username', 'password');
return var_dump($credentials);
if(Auth::attempt($credentials))
{
return 'Logged In.';
}
return Redirect::back()->withInput();
If i try the first line
$credentials = Input::only('username', 'password');
the message i get is
array(2) { ["username"]=> string(7) "dukejib" ["password"]=> string(9) "myownpass" }
After removing this line (so that i can go to auth::attemp) i get back to login page.
Yes. I tried with $primarykey too. By the way, my primary key isn't email.
Ok. It seems i was neglecting the clearly stated information from authentication page "The attempt method accepts an array of key / value pairs as its first argument. The password value will be hashed."
So , after hashing the password. The system is working fine.
Thanks All.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community