27 lines
827 B
PHP
27 lines
827 B
PHP
<?php
|
|
|
|
namespace App\Endpoint\Api\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class OfflineOrderItemResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'order_id' => $this->order_id,
|
|
'product_category_id' => $this->product_category_id,
|
|
'product_category' => OfflineProductCategoryResource::make($this->whenLoaded('productCategory')),
|
|
'products_total_amount' => $this->products_total_amount,
|
|
'discount_reduction_amount' => $this->discount_reduction_amount,
|
|
];
|
|
}
|
|
}
|