ok
Direktori : /home2/selectio/public_html/limpiar.in.net/updates/app/Http/Resources/V2/ |
Current File : /home2/selectio/public_html/limpiar.in.net/updates/app/Http/Resources/V2/SubCategoryCollection.php |
<?php namespace App\Http\Resources\V2; use Illuminate\Http\Resources\Json\ResourceCollection; class SubCategoryCollection extends ResourceCollection { public function toArray($request) { return [ 'data' => $this->collection->map(function($data) { return [ 'name' => $data->name, 'subSubCategories' => new SubSubCategoryCollection($data->subSubCategories), 'links' => [ 'products' => route('products.subCategory', $data->id) ] ]; }) ]; } public function with($request) { return [ 'success' => true, 'status' => 200 ]; } }