Edit File: OrdersItemResource.php
<?php namespace App\Http\Resources\Api\Provider; use Illuminate\Http\Resources\Json\JsonResource; class OrdersItemResource extends JsonResource { public function toArray($request) { return [ 'id' => $this?->id, 'product' => ProductResource::make($this->product), 'quantity' => $this?->quantity, 'unit_price' => number_format($this->unit_price, 2), 'price_after_discount' => number_format(isset($this->prices['after']) ? $this->prices['after'] : 0, 2), 'price_without_discount' => number_format(isset($this->prices['before']) ? $this->prices['before'] : 0, 2), 'total' => number_format($this->total, 2), 'total_incl_addons' => number_format($this->total_incl_addons, 2), 'addons' => OrdersItemAddonResource::collection($this->orderItemAddons), 'currency' => __('site.currency'), 'created_at' => $this->created_at, ]; } }
Back to File Manager