Support the ongoing development of Laravel.io →
Authentication
Last updated 4 months ago.
0

Have you tried to

dd($userdata);

?

0

yeah. I've tried

dd($userdata)

and it is returning correct info.

0

can you try to add this to your model ?

protected $primaryKey = 'email';
0

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();
0

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.

Last updated 7 years ago.
0

have you tried to add this

protected $primaryKey = 'email';
0

Yes. I tried with $primarykey too. By the way, my primary key isn't email.

0

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.

0

Sign in to participate in this thread!

LoadForge

Your banner here too?

dukejib dukejib Joined 14 May 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.