I'm using my own auth model, fully different with laravel's built-in user model, but using Authenticable by laravel. When I try to login by that user, I cannot generate the token, $token = auth()->login($user);
Your environment
Q
A
Bug?
no
New Feature?
no
Framework
Laravel
Framework version
^8.0
Package version
^1.0
PHP version
7.3.28
Steps to reproduce
Note: the credentials of my auth model is using Username and Passwd column.
Auth model:
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
class MUser extends Authenticatable implements JWTSubject
{
use Notifiable;
protected $table = 'muser';
protected $primaryKey = 'UserID';
protected $hidden = ['Passwd'];
}
Subject of the issue
I'm using my own auth model, fully different with laravel's built-in user model, but using Authenticable by laravel. When I try to login by that user, I cannot generate the token,
$token = auth()->login($user);
Your environment
Steps to reproduce
Note: the credentials of my auth model is using
Username
andPasswd
column. Auth model:Auth config:
In controller:
Expected behaviour
Token generated
Actual behaviour
null
generated