36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class QuoteResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
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'),
|
|
];
|
|
}
|
|
}
|