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>
33 lines
958 B
PHP
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(),
|
|
];
|
|
}
|
|
}
|