Change SQL query of laravel Auth with ID
Hello, I would like to use this:
Auth::loginUsingId($user['uid'], true);
The problem is that in the database, the column of the id is not id, but uid. How do I have to change the SQL query?
Error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select * fromtkl_userswhereid= 1 limit 1)
Thanks
I think you need to update your User model on trhee places
class User
{
protected $casts = [
'uid' => 'string'
];
protected $primaryKey = "uid";
public $incrementing = false;
}
I believe this should do the job!
Please or to participate in this conversation.