Exemplo n.º 1
0
 public function index(Manager $fractal, FarmerTransformer $farmerTransformer)
 {
     // show all
     $records = Farmer::all();
     $collection = new Collection($records, $farmerTransformer);
     $data = $fractal->createData($collection)->toArray();
     return $this->respond($data);
 }
Exemplo n.º 2
0
 public function index()
 {
     // show all
     $records = Farmer::all();
     return $records;
 }