/** * 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'); }
public function export() { $karyawan = new Karyawan(); //$karyawan->count() handle if count 0 $karyawans = Karyawan::get($karyawan->getFillable())->toArray(); return ExcelHelper::export($karyawans); }
/** * Get an excel table export. * * @return Response */ public function export() { $tipeakun = new TipeAkun(); $tipeakuns = $tipeakun->get($tipeakun->getFillable()); $tipeakuns = $tipeakuns->toArray(); if ($tipeakuns == []) { return view('tipeakun.export'); } return ExcelHelper::export($tipeakuns, 'tipeakuns'); }
/** * Create an Excel file to help user fill the * table to import. * * @param Model that instanced * @return File excel */ public static function template(Model $model) { $fillable = $model->getFillable(); foreach ($fillable as $key => $value) { $fillable[$key] = ucwords(str_replace('_', ' ', $value)); } $upgrades = ExcelHelper::upgrade($fillable); return ExcelHelper::export($upgrades, $model->getTable()); }
/** * Get an excel table export. * * @return Response */ public function export() { // $akun = new Akun(); // $akun = $akun->get($akun->getFillable()); // $akun = $akun->toArray(); // if ($akun == []) { // return view('akun.export'); // } // return ExcelHelper::export($akun, 'akun'); $akuns = []; foreach (Akun::get() as $akun) { $q['No Akun'] = $akun->no_akun; $q['Nama'] = $akun->nama; $q['Tipe'] = $akun->tipeakun->nama; $q['Mata Uang'] = $akun->mata_uang; $q['Saldo Awal'] = $akun->saldo_awal; $q['Tanggal'] = $akun->tanggal; array_push($akuns, $q); } if ($akuns == []) { return view('akun.export'); } return ExcelHelper::export($akuns, 'akun'); }