Skip to content

Commit

Permalink
#27, Code for redirecting to answer page with ID is done
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenraam committed Oct 25, 2024
1 parent c7050d3 commit fa5b58d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Alumni-Project/app/Http/Controllers/ForumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function viewQuestions(){
}

public function viewAnswers(){
return view('forum.viewAnswers');
return view('forum.viewAnswer');
}

public function createQuestion(){
Expand Down
1 change: 0 additions & 1 deletion Alumni-Project/resources/views/forum/addQuestion.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<i class="mtrl-select"></i>
</div>


<div class="form-group">
<textarea type="text" name="body" id="body" required></textarea>
<label for="body" class="control-label">Question Body</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<h5>{{ $question->title }}</h5>
<p>{{ $question->body }} </p>
</div>
<a href="{{ route('question.answers', ['id' => $question->id]) }}" class="btn btn-light-blue" style="margin-left:10px">Answers Question</a>
<a href="forum/answer/{{$question->id}}" class="btn btn-light-blue" style="margin-left:10px">Answers Question</a>
</div>
</li>
@endforeach
Expand Down
3 changes: 2 additions & 1 deletion Alumni-Project/routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@

// View Forum
Route::get('/alumni/forum',[ForumController::class,'viewQuestions']);
Route::get('/alumni/forumAnswers',[ForumController::class,'viewAnswers'])->name('question.answers');
Route::get('/alumni/forum/answer/{id}',[ForumController::class,'viewAnswers'])->name('question.answers');

// Change password
Route::get('/alumni/change-password',[AlumniLoginController::class,'showChangePasswordForm'])->name('alumni.change-password.form');
Expand Down Expand Up @@ -219,6 +219,7 @@
Route::get('/student/forum', [ForumController::class, 'viewQuestions'])->name('forum.index');
Route::get('/student/forum/add', [ForumController::class, 'createQuestion']);
Route::post('/student/forum/add/post', [ForumController::class, 'storeQuestion'])->name('questions.store');
Route::get('/student/forum/answer/{id}',[ForumController::class,'viewAnswers']);

});

Expand Down

0 comments on commit fa5b58d

Please sign in to comment.