private function edit2($id) { $barang = BarangModel::all(); $data = []; foreach ($barang as $value) { $data[$value->id] = $value->nama_barang; } return $data; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $barang = BarangModel::find($id); $barang->delete(); // notif Session::flash('message', 'data di hapus'); // redirect return Redirect::to('barang'); }