We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 836723c + d158826 commit cd1f41eCopy full SHA for cd1f41e
src/Entities/AccessToken.php
@@ -12,6 +12,8 @@
12
*/
13
class AccessToken extends Entity
14
{
15
+ private ?User $user = null;
16
+
17
/**
18
* @var array<string, string>
19
@@ -33,13 +35,14 @@ class AccessToken extends Entity
33
35
34
36
public function user(): ?User
37
- if (empty($this->attributes['user'])) {
38
+ if ($this->user === null) {
39
helper('auth');
- $users = auth()->getProvider();
- $this->attributes['user'] = $users->findById($this->user_id);
40
41
+ $users = auth()->getProvider();
42
+ $this->user = $users->findById($this->user_id);
43
}
44
- return $this->attributes['user'];
45
+ return $this->user;
46
47
48
0 commit comments