get() ->sortDesc(); return view('admin.pertanyaan.index', compact('pertanyaans', 'session_user')); } /** * Remove the specified resource from storage. * * @param \App\Models\Pertanyaan $pertanyaan * @return \Illuminate\Http\Response */ public function destroy(Pertanyaan $pertanyaan) { Pertanyaan::destroy($pertanyaan->id); return redirect('/admin/pertanyaan')->with('status', 'Pertanyaan Berhasil Dihapus'); } public function restore($id) { $pertanyaan = Pertanyaan::withTrashed() ->where('id', $id) ->first(); $pertanyaan->restore(); return redirect('/admin/pertanyaan')->with('status', 'Pertanyaan Berhasil Direstore'); } public function delete($id) { $pertanyaan = Pertanyaan::withTrashed() ->where('id', $id) ->first(); $pertanyaan->forceDelete(); return redirect('/admin/pertanyaan')->with('status', 'Pertanyaan Berhasil Dihapus Permanen'); } }