added crypto pm and activation key system
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user