public function updateDokter(Request $request, $id) { $dokter = Dokter::findOrFail($id); $format_tgl_info_old = Input::get('tanggal_lahir'); $this->validate($request, ['nama_dokter' => 'required', 'nik' => 'required|max:16|min:16', 'jenis_kelamin' => 'required', 'tanggal_lahir' => 'required', 'alamat' => 'required', 'telepon' => 'required', 'id_poli' => 'required', 'email' => 'required', 'spesialisasi' => 'required']); $input = $request->all(); $dokter->fill($input)->save(); Dokter::where('id', $id)->update(array('tanggal_lahir' => date("Y-m-d", strtotime($format_tgl_info_old)))); Session::flash('edit_message', 'Dokter ' . $id . ' berhasil dimutakhirkan!'); return redirect(action('UsersController@editDokter', $dokter->id)); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($faskes, $id) { Dokter::findOrFail($id)->delete(); return redirect('faskes/' . $faskes . '/dokter')->with('message', 'Dokter Berhasil ditambahkan'); }
/** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create($faskes, $id) { $dokter = Dokter::findOrFail($id); return view('faskes.dokter.praktek.create', compact('dokter')); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id, $dokter_id) { // Dokter::findOrFail($dokter_id)->delete(); return 'success'; }