public function update(Request $request, $id)
 {
     if ($request->isMethod('get')) {
         $data['item'] = Resep::find($id);
         $data['kokis'] = Koki::all();
         return view('resep.update', $data);
     } elseif ($request->isMethod('post')) {
         $item = Resep::find($id);
         $item->nama = Input::get('nama');
         $item->kode = Input::get('kode');
         $item->koki_id = Input::get('koki_id');
         $item->save();
         return redirect('resep');
     }
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $items['koki'] = Koki::all();
     return view('koki.index', $items);
 }
Exemplo n.º 3
0
 public function index()
 {
     $data['items'] = Koki::all();
     return view('koki.index', $data);
 }
Exemplo n.º 4
0
 public function delete($id)
 {
     //
     $item = Koki::find($id);
     $item->delete();
     $item['koki'] = Koki::all();
     return redirect('koki');
 }