Files
website/website/app/Http/Resources/SubscriptionResource.php
Claude Dev 40c1ecc6fe Remove old Vuexy wrapper components (AppTextField, AppSelect, AppTextarea, FlashMessages, NotificationBell)
All pages now use native Vuetify components directly. Flash messages are handled
by the ToastStack component via Pinia store. Notifications use NotificationPanel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 17:10:23 -04:00

33 lines
958 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
/** @mixin \Laravel\Cashier\Subscription */
class SubscriptionResource extends JsonResource
{
/**
* @return array<string, mixed>
*/
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'name' => $this->type,
'stripe_status' => $this->stripe_status,
'plan' => $this->when($this->plan_name !== null, fn () => [
'name' => $this->plan_name,
'price' => $this->plan_price,
]),
'billing_cycle' => $this->plan_billing_cycle ?? null,
'current_period_end' => $this->current_period_end?->toIso8601String(),
'ends_at' => $this->ends_at?->toIso8601String(),
'created_at' => $this->created_at?->toIso8601String(),
];
}
}