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); }
/** * 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; }
public function index($id) { $peserta = Peserta::find($id); $data['peserta'] = $peserta; return view('soal', $data); }
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]; }