private function edit2($id) { $barang = BarangModel::all(); $data = []; foreach ($barang as $value) { $data[$value->id] = $value->nama_barang; } return $data; }
/** * Display a listing of the resource. * * @return Response */ public function index() { $barang = BarangModel::all(); return View::make('layouts.barang')->with('barang', $barang); }