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