lots of progress
This commit is contained in:
@@ -45,4 +45,17 @@ class User extends Authenticatable
|
||||
'password' => 'hashed',
|
||||
];
|
||||
}
|
||||
|
||||
public function subscriptions()
|
||||
{
|
||||
return $this->hasMany(UserSubscription::class);
|
||||
}
|
||||
|
||||
public function activeSubscription()
|
||||
{
|
||||
return $this->subscriptions()
|
||||
->where('status', 'active')
|
||||
->where('expires_at', '>', now())
|
||||
->first();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user