*/ public function toArray(Request $request): array { return [ 'id' => $this->id, 'client_id' => $this->client_id, 'group_id' => $this->group_id, 'reference' => $this->reference, 'status' => $this->status, 'quote_date' => $this->quote_date, 'valid_until' => $this->valid_until, 'currency' => $this->currency, 'total_ht' => $this->total_ht, 'total_tva' => $this->total_tva, 'total_ttc' => $this->total_ttc, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'client' => $this->whenLoaded('client'), 'group' => $this->whenLoaded('group'), 'lines' => QuoteLineResource::collection($this->whenLoaded('lines')), 'history' => DocumentStatusHistoryResource::collection($this->whenLoaded('history')), ]; } }