Skip to content

Commit

Permalink
#27, Code for fetching from the data base and sending to the page is …
Browse files Browse the repository at this point in the history
…done
  • Loading branch information
praveenraam committed Oct 26, 2024
1 parent fa5b58d commit 1c97fd7
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Alumni-Project/app/Http/Controllers/ForumController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class ForumController extends Controller
public function viewQuestions(){

$questions = Question::all();

return view('forum.viewQuestion',compact('questions'));
}

public function viewAnswers(){
return view('forum.viewAnswer');
public function viewAnswers($id){
$question = Question::with('answers')->findOrFail($id);
return view('forum.viewAnswer',compact('question'));
}

public function createQuestion(){
Expand All @@ -27,8 +27,6 @@ public function createQuestion(){

public function storeQuestion(Request $request)
{
// dump($request);

$id = Session::get('user_id');

// Validate the request data
Expand Down
36 changes: 36 additions & 0 deletions Alumni-Project/resources/views/forum/viewAnswer.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@extends('layouts.app')
@section('title', 'Add Questions')

@push('bodycontent')
<section>
<div class="gap gray-bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="row merged20" id="page-contents">
@include('layouts.includes.sidebar')
<div class="col-lg-9">
<div class="central-meta">
<div class="frnds">
<ul class="nav nav-tabs">
<li class="nav-item"><a class="active" href="" data-toggle="tab">Question</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active fade show">
<ul class="nearby-contct">
<li>

</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
@endpush

0 comments on commit 1c97fd7

Please sign in to comment.