I am creating a new laravel 4 backend based on an existing database. I have then a table named 'FormMembers' that contains email and passwords for my members.
I would like to use Auth:: functions like :
$credentials = array(
'sEmail' => Input::get('email'),
'sPassword' => Input::get('password')
);
if (Auth::attempt($credentials)) {
return Response::json(Auth::user());
} else {
return Response::json(array('flash' => 'invalid password or email.'), 500);
}
So I changed the table field in auth.php from 'users' to 'FormMembers' and did the same to the Users model. But when calling Auth::user() I got the error :
{"error":{"type":"ErrorException","message":"Undefined index: password","file":"\/home\/www\/accred\/web\/vendor\/laravel\/framework\/src\/Illuminate\/Auth\/EloquentUserProvider.php","line":75}}
Do you have any idea how I could manage it? Thanks