public function index(Manager $fractal, LoantypeTransformer $loantypeTransformer) { // show all $records = Loantype::all(); $collection = new Collection($records, $loantypeTransformer); $data = $fractal->createData($collection)->toArray(); return $this->respond($data); }