0

Basically, I'm having a problem with laravels built in auth my problem is it only accepts if username is spelled "username" and password "password" but I am using a different spelling username = user_name, password = passwd

this is my code

Auth::attempt(array(
    'user_name' => $data['email'],
    'passwd' => $data['password']
));

if( Auth::check() )
{
    return Redirect::intended('/');
}

my column name is user_name, passwd

if I use the code above it does not work but if i rename my column to username and password and change my code to this below it works, but unfortunate I am not allowed to do so

Auth::attempt(array(
    'user_name' => $data['email'],
    'passwd' => $data['password']
));
11
  • possible duplicate of laravel 4 custom named password column Commented Sep 26, 2014 at 18:34
  • why don't you change the name of the columns in your table? Commented Sep 26, 2014 at 18:56
  • check this mindworksdev.com/2013/06/… Commented Sep 26, 2014 at 22:18
  • as stated in my post, renaming my columns is not allowed Commented Sep 27, 2014 at 3:31
  • @TheShiftExchange thank you for your comment, now I understand :) Is it possible to manually log the users but not using auth::attempt and store it in Auth session? Commented Sep 27, 2014 at 8:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.