Пример #1
0
 public function updatePeserta(Request $request, $id)
 {
     $peserta = Peserta::find($id);
     $peserta->nama = $request->input('nama');
     $peserta->nip = $request->input('nip');
     $peserta->sex = $request->input('sex');
     $peserta->tgllahir = $request->input('tgllahir');
     $peserta->biodata = $request->input('biodata');
     $peserta->save();
     return response()->json($peserta);
 }
Пример #2
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $semua_jawaban = Peserta::where('id', '=', $id)->pluck('jawaban');
     return $semua_jawaban;
 }
Пример #3
0
 public function index($id)
 {
     $peserta = Peserta::find($id);
     $data['peserta'] = $peserta;
     return view('soal', $data);
 }
Пример #4
0
 public function insert()
 {
     Peserta::create(array('jawaban' => Input::get('jawaban')));
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     $peserta = Peserta::find($id);
     $peserta->delete();
     return ['success' => true];
 }