Y
Y
ylebedev2014-08-28 02:48:18
MySQL
ylebedev, 2014-08-28 02:48:18

How to assign or select fields in Laravel Authorization?

How does authorization in Laravel understand to use user, login, email columns in the database?
And how can you reassign them? For example on User1 and further use for Auth::

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
ylebedev, 2014-08-28
@ylebedev

not checked, but I'm starting to guess that the columns are selected in the controller itself.
(well, plus more additions in the models that the password is password1)
MYSQL
login1 | password1

public function authenticateUser(){
$userdata = array(
'login1' => Input::get('login'),
'password1' => Input::get('password')
);
if( Auth::attempt($userdata) ) {
return Redirect::to('/admin');
} else {
return View::make('auth.loginform', array(
'error' => 'user data is incorrect',
'old_input' => Input::all()
));
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question