I'm doing a login with laravel, I had a table already created. The problem is that in my table the id has another name and when trying to login it shows me this error.
"Undefined index: id"
This is User.php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable {
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $primaryKey = 'IdPersonal';
protected $fillable = [
'nombres', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
}
I understand that I have to change id by the name of the column that I have in my table but I do not know how to do it.