Edit File: ProductAdditiveCategoryResource.php
<?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; use App\Http\Resources\ProductAdditiveResource; class ProductAdditiveCategoryResource extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) { $product_additives = $this->productAdditives; return [ 'id' => $this->id, 'name' => $this->name, 'product_additives' => ProductAdditiveResource::collection($product_additives), ]; } }
Back to File Manager