Edit File: ProductAddonResource.php
<?php namespace App\Http\Resources\Api\Provider; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Http\Request; use Illuminate\Http\Resources\Json\JsonResource; use JsonSerializable; class ProductAddonResource extends JsonResource { /** * Transform the resource into an array. * * @param Request $request * @return array|Arrayable|JsonSerializable */ public function toArray($request) { return [ 'id' => $this?->id, 'name' => $this?->name, 'description' => $this?->description, 'translated_names' => $this?->getTranslations('name'), 'translated_description' => $this?->getTranslations('description'), 'price' => newNumberFormat($this?->price), 'image' => $this->image, ]; } }
Back to File Manager