feat: revenue cat
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class BillingProductResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'purpose' => $this->purpose,
|
||||
'amount' => $this->amount,
|
||||
'currency' => $this->currency,
|
||||
'formattedAmount' => $this->formattedAmount(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,12 @@ class UserResource extends JsonResource
|
||||
'certificationPurchased' => $this->hasPurchasedCertification(),
|
||||
'canAnalyzeMeals' => $this->canAnalyzeMeals(),
|
||||
'analysisAccessLevel' => $this->analysisAccessLevel(),
|
||||
'trialEndsAt' => $this->trial_ends_at?->toISOString(),
|
||||
'hasActiveSubscription' => $this->subscribed('default'),
|
||||
'trialEndsAt' => $this->analysisAccessLevel() === 'trial'
|
||||
? $this->subscription_expires_at?->toISOString()
|
||||
: null,
|
||||
'subscriptionExpiresAt' => $this->subscription_expires_at?->toISOString(),
|
||||
'subscriptionProductId' => $this->subscription_product_id,
|
||||
'hasActiveSubscription' => $this->hasActiveSubscription(),
|
||||
'suspendedAt' => $this->suspended_at?->toISOString(),
|
||||
'physicalActivityLevel' => $this->physical_activity_level,
|
||||
'physicalActivityLevelLabel' => $this->physical_activity_level?->getLabel(),
|
||||
|
||||
Reference in New Issue
Block a user