File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 5
5
use DateTimeInterface ;
6
6
use Illuminate \Support \Str ;
7
7
8
+ /**
9
+ * @template TTokenModel of \Illuminate\Database\Eloquent\Model&\Laravel\Sanctum\Contracts\HasAbilities = \Laravel\Sanctum\PersonalAccessToken
10
+ */
8
11
trait HasApiTokens
9
12
{
10
13
/**
11
14
* The access token the user is using for the current request.
12
15
*
13
- * @var \Laravel\Sanctum\Contracts\HasAbilities
16
+ * @var TTokenModel
14
17
*/
15
18
protected $ accessToken ;
16
19
17
20
/**
18
21
* Get the access tokens that belong to model.
19
22
*
20
- * @return \Illuminate\Database\Eloquent\Relations\MorphMany
23
+ * @return \Illuminate\Database\Eloquent\Relations\MorphMany<TTokenModel, $this>
21
24
*/
22
25
public function tokens ()
23
26
{
@@ -75,7 +78,7 @@ public function generateTokenString()
75
78
/**
76
79
* Get the access token currently associated with the user.
77
80
*
78
- * @return \Laravel\Sanctum\Contracts\HasAbilities
81
+ * @return TTokenModel
79
82
*/
80
83
public function currentAccessToken ()
81
84
{
@@ -85,7 +88,7 @@ public function currentAccessToken()
85
88
/**
86
89
* Set the current access token for the user.
87
90
*
88
- * @param \Laravel\Sanctum\Contracts\HasAbilities $accessToken
91
+ * @param TTokenModel $accessToken
89
92
* @return $this
90
93
*/
91
94
public function withAccessToken ($ accessToken )
You can’t perform that action at this time.
0 commit comments