lots of progress

This commit is contained in:
2025-03-31 23:49:32 +03:00
parent 5b26f832cd
commit 213f0ea8f1
17 changed files with 1067 additions and 68 deletions
+13
View File
@@ -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();
}
}