/** * Get an excel table export. * * @return Response */ public function export() { $barang = new Barang(); $barangs = $barang->get($barang->getFillable()); $barangs = $barangs->toArray(); if ($barangs == []) { return view('barang.export'); } return ExcelHelper::export($barangs, 'barangs'); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $data = Barang::get(['id', 'nama', 'kuantitas', 'keterangan'])->toArray(); //return view('pre', compact('data')); return view('barang.index', compact('data')); }