I already search for this thing but I'm really new at this and I can't figure it out how to make it work. I'm using a project without many changes so I have my User.php as it comes but I add this:
protected $fillable = ['username', 'email', 'password'];//GEN_ID_Usuario
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
/**
* The eloquent relation to assigment a "formulario" model.
*
*/
public function getAuthPassword()
{
return $this->Usu_Contrasenia;
}
And I have my AuthController as default but I added this:
public function authenticate()
{
$email = $input['email'];
$password = $input['password'];
if (Auth::attempt(array('Usu_Email' => $email, 'Usu_Contrasenia' =>
$password)))
{
return redirect()->intended('dashboard');
}
}
Everything else in the project it's by default, just trying to use username, email and password as: Usu_Nombre, Usu_Email and Usu_Contrasenia.