29 lines
844 B
PHP
29 lines
844 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class AvoirLineResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'avoir_id' => $this->avoir_id,
|
|
'product_id' => $this->product_id,
|
|
'invoice_line_id' => $this->invoice_line_id,
|
|
'description' => $this->description,
|
|
'quantity' => $this->quantity,
|
|
'unit_price' => $this->unit_price,
|
|
'tva_rate' => $this->tva_rate,
|
|
'total_ht' => $this->total_ht,
|
|
'total_tva' => $this->total_tva,
|
|
'total_ttc' => $this->total_ttc,
|
|
'notes' => $this->notes,
|
|
'product' => $this->whenLoaded('product'),
|
|
];
|
|
}
|
|
}
|