In the details page, we need to show the full question to the user. Also there will be a place for the answers. To create our question page, we perform the following steps:
QuesionsController.php
file under app/controllers
:/** * Details page **/ public function getDetails($id,$title) { //First, let's try to find the question: $question = Question::with('users','tags')->find($id); if($question) { //We should increase the "viewed" amount $question->update(array( 'viewed' => $question->viewed+1 )); return View::make('qa.details') ->with('title',$question->title) ->with('question',$question); } else { return Redirect::route('index') ...
No credit card required