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