I got the next code:
public function registrarUsu(){
$datosregistro = array(
null,
"Carlos Delgado",
"Gonzalez Padron",
Input::get('username'),
Hash::make(Input::get('contrasena')),
);
$consulta = DB::insert('insert into usuarios (id, nombres, apellidos, nick_name, contrasena) values ( ?, ?, ?, ?, ?)', $datosregistro);
DB::commit($consulta);
}
This what it does is; grabs the username and password from a simple login form which I early created, it does what it does, grabs all the data and saves it to the database (The static fields are just for demonstration). The problem is when i try to authenticate the user with the next function:
public function loguearUsu(){
$datosdeusu = array(
'nick_name' => Input::get('username'),
'contrasena' => Input::get('Contrasena'),
);
if(Auth::attempt($datosdeusu)){
return Redirect::to('/');
}}
I think that the problem is the password, every time i tried to login it just return false, but if I use a var_dump it shows the username and password just as they are in the database, so what am i doing wrong?