Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <div class="col-xs-12 col-sm-12 col-md-12">
  2. <div class="form-group">
  3. <strong>Kelas:</strong>
  4. {!! Form::select('idkelas', $kelas_theresia, [], array('class' => 'form-control')) !!}
  5. </div>
  6. </div>
  7.  
  8. public function edit($id)
  9. {
  10. $kamar_theresia = Kamar_Theresia::find($id);
  11. $kelas_theresia = Kelas_Theresia::pluck('name','id')->all();
  12. return view('kamar_theresia.edit',compact('kamar_theresia','kelas_theresia'));
  13. }
  14.  
  15. /**
  16. * Update the specified resource in storage.
  17. *
  18. * @param IlluminateHttpRequest $request
  19. * @param AppProduct $product
  20. * @return IlluminateHttpResponse
  21. */
  22.  
  23. public function update(Request $request, $id)
  24. {
  25. request()->validate([
  26. 'nama' => 'required',
  27. 'idkelas' => 'required',
  28. 'ketersediaan' => 'required',
  29. ]);
  30.  
  31. $input = $request->all();
  32. $kamar_theresia = Kamar_Theresia::find($id);
  33. $kamar_theresia->update($input);
  34.  
  35. return redirect()->route('kamar_theresia.index')
  36. ->with('success','Kamar Theresia updated successfully');
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement