Edit File: OrderProductsResource.php
<?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; use App\Models\Category; class OrderProductsResource extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) { return [ 'id' => $this->product?->id ?? 0, 'image' => $this->product->image?$this->product->imagePath:'', 'name' => $this->product->name?$this->product->name:'', 'description' => $this->product->desc?$this->product->desc:'', 'price' => $this->total_price(), 'qty' => $this->qty, // 'additives' => $this->additives_text(), 'additives' => '('. implode( '-' ,$this->group->ProperitiesName) .')' .$this->additives_text() , ]; } }
Back to File Manager