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.
1 parent 4892810 commit 3b6e2c8Copy full SHA for 3b6e2c8
src/Auth/UsesSubscriptions.php
@@ -27,15 +27,17 @@ trait UsesSubscriptions
27
public function subscription(): ?array
28
{
29
if (
30
- !$this->subscription && $this->subscription = db()
31
- ->select('subscriptions')
32
- ->where('user_id', $this->id())
33
- ->first() ?? null
+ !$this->subscription && (
+ $this->subscription = db()
+ ->select('subscriptions')
+ ->where('user_id', $this->id())
34
+ ->first()
35
+ )
36
) {
37
$this->subscription['tier'] = billing()->tier($this->subscription['plan_id']);
38
}
39
- return $this->subscription;
40
+ return $this->subscription ? $this->subscription : null;
41
42
43
/**
0 commit comments