示例#1
0
 public function index(Manager $fractal, LoanTransformer $loanTransformer)
 {
     // show all records
     $records = Loan::with('agents', 'analyst', 'applicants.corps', 'applicants.entity', 'applicants.fins', 'applicants.joints', 'applicants.partners', 'applicants.state', 'attachments.user', 'buyers', 'closingdocs', 'comments.responses.user', 'comments.status', 'comments.user', 'committee.role', 'committee.user', 'conditions', 'crophail.crop', 'crophail.county', 'databases.inspols', 'disbursements', 'discounts', 'distributor.states', 'exceptions', 'expenses.crop', 'farmers.applicants.entity', 'farmers.applicants.state', 'farms.aphdb.inspols', 'farms.county.state', 'farms.units', 'farmunits.database.inspols', 'farmunits.farm.county.state', 'farmunits.practices', 'financials', 'fsapayments.crop', 'fsapayments.farms.county.state', 'indyinc', 'inspols.agent', 'inspols.county', 'inspols.crop', 'inspols.databases.farms', 'loancrops.crop', 'loancrops.practices.farm.aphdb.inspols', 'loancrops.practices.farm.county.state', 'loancrops.yields', 'loandistributor.distributor', 'loantypes', 'location.regions', 'othercollateral', 'plannedcrops', 'practices', 'priorliens', 'quests', 'rebators', 'references', 'status', 'storage', 'systemics', 'tabstats', 'termmods', 'transactions')->get();
     $collection = new Collection($records, $loanTransformer);
     $data = $fractal->createData($collection)->toArray();
     return $this->respond($data);
 }