Skip to content

Commit b24c646

Browse files
[12.x] Add refreshToken relation to Token model (#1739)
* Add refreshToken relation * Update Token.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 66eaa66 commit b24c646

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Token.php

+10
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ public function client()
5757
return $this->belongsTo(Passport::clientModel());
5858
}
5959

60+
/**
61+
* Get the refresh token associated with the token.
62+
*
63+
* @return \Illuminate\Database\Eloquent\Relations\HasOne
64+
*/
65+
public function refreshToken()
66+
{
67+
return $this->hasOne(Passport::refreshTokenModel(), 'access_token_id');
68+
}
69+
6070
/**
6171
* Get the user that the token belongs to.
6272
*

0 commit comments

Comments
 (0)