<?php

namespace App\Http\Resources\Billing;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class InvoiceResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            ...parent::toArray($request),
            'tenant' => $this->whenLoaded('tenant'),
            'customer' => $this->whenLoaded('customer'),
            'billing_profile' => $this->whenLoaded('billingProfile'),
        ];
    }
}
