I can not update the remember_token column - Laravel

1

Hi, I'm doing a login with laravel and if everything works fine, the problem I have is that when I log out I get this error:

SQLSTATE[42S22]: [Microsoft][ODBC Driver 13 for SQL Server][SQL 
Server]El nombre de columna 'id' no es válido. (SQL: update 
[Tab_Personal] set [remember_token] = 
SUW7wfTLsMVMeMW36uxATEV8HWI6rYRCGdhsYoDzpZcSj0j2L6UMznauoTmU where 
[id] 
is null)

My function to close session is this.

public function doLogout() {
    Auth::logout();
    return Redirect::to('/login')->with('msg', 'Gracias por 
    visitarnos!.');
}
    
asked by cristians bregante 07.10.2017 в 00:20
source

1 answer

1

You have to validate if the id column exists in your user table.

You can edit your table so that the station is the id column. You can also tell Laravel who your PK will be.

Defining primary key (PK) laravel in the file

  

Path where you should put the code app \ User.php

$primaryKey ='idPersonalizado';

With this you already solve your error. Keep in mind that when you log out a token and date of update of the table is registered, you can create the fields also if you do not have them. remember_token and updated_at .

    
answered by 30.10.2017 / 15:24
source