added crypto pm and activation key system

This commit is contained in:
Gitea
2025-05-16 11:24:08 +05:30
parent 23b5a45d0b
commit 93515e7845
11 changed files with 454 additions and 13 deletions

View File

@@ -35,7 +35,10 @@ class Dashboard extends Component
$user = auth()->user();
$userId = $user->id;
if ($user->subscribed()) {
$subscription = $user->subscriptions()->where(['stripe_status' => 'active'])->orderByDesc('updated_at')->first();
$subscription = $user->subscriptions()
//->where(['stripe_status' => 'active'])
->orderByDesc('updated_at')
->first();
if ($subscription !== null) {
$subscriptionId = $subscription->stripe_id;
$cacheKey = "stripe_check_executed_user_{$userId}_{$subscriptionId}";
@@ -74,7 +77,7 @@ class Dashboard extends Component
]);
}
}
Cache::put($cacheKey, true, now()->addHour());
Cache::put($cacheKey, true, now()->addMinute());
} catch (Exception $exception) {
\Log::error($exception->getMessage());
}
@@ -176,7 +179,7 @@ class Dashboard extends Component
$userPriceID = $result['items'][0]['stripe_price'];
$subscriptionEnd = $result['ends_at'];
$planName = null; // Default value if not found
$planName = null;
foreach (config('app.plans') as $plan) {
if ($plan['pricing_id'] === $userPriceID) {