Skip to content

Commit

Permalink
Nonstandard ID in the token's relationship with the user (#1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
Afonso Gloeden authored May 12, 2020
1 parent 343e3ea commit 515cc10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function user()
{
$provider = config('auth.guards.api.provider');

return $this->belongsTo(config('auth.providers.'.$provider.'.model'));
$model = config('auth.providers.'.$provider.'.model');

return $this->belongsTo($model, 'user_id', (new $model)->getKeyName());
}

/**
Expand Down

0 comments on commit 515cc10

Please sign in to comment.