public function destroy($slug) { $question = Question::whereSlug($slug)->firstOrFail(); $question->delete(); return redirect('/questions')->with('status', 'The Question ' . $slug . ' has been deleted!'); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($slug) { $question = $this->question->whereSlug($slug)->firstorFail(); return view('questions.show')->withQuestion($question); }