et#10
Mahesh Sharma 2 years ago
parent b5e126e207
commit 6133ab4714
  1. 31
      app/Http/Controllers/Admin/FaqController.php
  2. 16
      app/Http/Controllers/FaqController.php
  3. 12
      app/Models/Faq.php
  4. 36
      database/migrations/2023_02_01_060849_create_faqs_table.php
  5. BIN
      public/f7f3ee09c49b9166801b81a4c76b0160.png
  6. 108
      resources/views/admin/faq/create.blade.php
  7. 94
      resources/views/admin/faq/edit.blade.php
  8. 105
      resources/views/admin/faq/index.blade.php
  9. 86
      resources/views/admin/faq/show.blade.php
  10. 8
      resources/views/admin/layouts/menubar.blade.php
  11. 22
      resources/views/faq.blade.php
  12. 17
      routes/web.php

@ -5,18 +5,18 @@ namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Service;
use App\Models\ServiceOld;
use App\Models\ServiceFaq;
use App\Models\Faq;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
class ServiceFaqController extends Controller
class FaqController extends Controller
{
protected $view= 'admin.service_faq.';
protected $redirect = 'admin/service_faqs';
protected $view= 'admin.faq.';
protected $redirect = 'admin/faqs';
public function index(){
$settings = ServiceFaq::paginate(config('custom.per_page'));
$settings = Faq::paginate(config('custom.per_page'));
return view($this->view.'index',compact('settings'));
}
@ -34,21 +34,21 @@ class ServiceFaqController extends Controller
]);
$requestData = $request->all();
$setting = ServiceFaq::create($requestData);
Session::flash('success','ServiceFAQ is created');
$setting = Faq::create($requestData);
Session::flash('success','FAQ is created');
return redirect($this->redirect);
}
public function edit($id){
$setting = ServiceFaq::findorfail($id);
$setting = Faq::findorfail($id);
$services = Service::all();
return view($this->view.'edit',compact('setting'),compact('services'));
}
public function update(Request $request, $id){
$setting =ServiceFaq::findorfail($id);
$setting =Faq::findorfail($id);
$this->validate(\request(), [
'question' =>'required|string',
'answer'=>'required',
@ -59,8 +59,19 @@ class ServiceFaqController extends Controller
$requestData = $request->all();
$setting->fill($requestData);
$setting->save();
Session::flash('success','CourseFAQ is Updated');
Session::flash('success','FAQ is Updated');
return redirect($this->redirect);
}
public function show($id)
{
$faq = new Faq();
$setting = $faq->findorfail($id);
return view($this->view . 'show', compact('setting'));
}
}

@ -0,0 +1,16 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Faq;
use App\Models\Page;
class FaqController extends Controller
{
public function index(){
$page = Page::where(['title' => 'FAQ','status' => 1])->first();
$faqs = Faq::where('status',true)->get();
return view('faq',compact('faqs','page'));
}
}

@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Faq extends Model
{
use HasFactory;
protected $guarded = ['id'];
}

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('faqs', function (Blueprint $table) {
$table->id();
$table->bigInteger('service_id')->unsigned()->nullable();
$table->foreign('service_id')->references('id')->on('services');
$table->longText('question');
$table->longText('answer');
$table->enum('status',[1,2]);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('faqs');
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

@ -0,0 +1,108 @@
@extends('admin.layouts.app')
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>FAQ</h1>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<!-- SELECT2 EXAMPLE -->
<div class="card card-default">
<div class="card-header">
<h3 class="card-title">FAQ</h3>
<a href="{{url('admin/faqs')}}" class="back-button">List</a>
</div>
<div class="card-body">
@include('success.success')
@include('errors.error')
{!! Form::open(['url' => '/admin/faqs', 'class' => 'form-horizontal', 'method'=> 'POST','files' => true]) !!}
<div class="row">
<!-- <div class="col-md-4">
<div class="form-group">
<label>Service Name <span style="color: red">*</span> </label>
<select name="service_id" class="form-control" id="type" required >
<option value="" selected disabled>Please select Service Course</option>
@foreach($settings as $setting)
<option value="{{$setting->id}}" @if(old('service_id') == $setting->id) selected @endif>{{$setting->name}}</option>
@endforeach
</select>
</div>
</div> -->
<div class="col-md-12">
<div class="form-group">
<label>Question <span style="color: red">*</span> </label>
<textarea name="question" class="summernote_class">{{old('question')}}
</textarea>
</div>
</div>
<div class="col-md-12" >
<div class="form-group" >
<label>Answer <span style="color: red">*</span> </label>
<textarea name="answer" class="summernote_class">{{old('answer')}}
</textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Status <span style="color: red">*</span> </label>
<select name="status" class="form-control" id="type" required>
<option value="" selected disabled>Please select Status</option>
@foreach(config('custom.status') as $in => $val)
<option value="{{$in}}" @if(old('status') == $in) selected @endif>{{$val}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="value_section">
</div>
</div>
</div>
<div class="form-group row create-button">
<div class="col-sm-10 col-md-12">
<button type="submit" class="btn btn-primary">Create</button>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</section>
</div>
@endsection
@section('script')
<script>
$(document).ready(function() {
$('.summernote_class').summernote()
})
</script>
@endsection

@ -0,0 +1,94 @@
@extends('admin.layouts.app')
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>FAQ</h1>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<!-- SELECT2 EXAMPLE -->
<div class="card card-default">
<div class="card-header">
<h3 class="card-title">Edit FAQ</h3>
<a href="{{url('admin/faqs')}}" class="back-button">List</a>
</div>
<div class="card-body">
@include('success.success')
@include('errors.error')
{!! Form::open(['url' => '/admin/faqs/'.$setting->id, 'class' => 'form-horizontal', 'method'=> 'POST','files' => true]) !!}
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label>Question <span style="color: red">*</span> </label>
<textarea class="summernote_class" id="inputPassword3" name="question">{{$setting->question}}</textarea>
</div>
</div>
<div class="col-md-12" >
<div class="form-group" >
<label>Answer <span style="color: red">*</span> </label>
<textarea name="answer" class="summernote_class">{{$setting->answer}}
</textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Status <span style="color: red">*</span> </label>
<select name="status" class="form-control" id="type" required>
<option value="" selected disabled>Please select Status</option>
@foreach(config('custom.status') as $in => $val)
<option value="{{$in}}" {{($setting->status==$in) ? 'selected' : '' }}> {{$val}} </option>
@endforeach
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="value_section">
</div>
</div>
</div>
<div class="form-group row create-button">
<div class="col-sm-10 col-md-12">
<button type="submit" class="btn btn-primary">Update</button>
</div>
</div>
{!! Form::close() !!}
</div>
</div>
</div>
</section>
</div>
@endsection
@section('script')
<script>
$(document).ready(function() {
$('.summernote_class').summernote()
})
</script>
@endsection

@ -0,0 +1,105 @@
@extends('admin.layouts.app')
@section('content')
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>FAQs</h1>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">FAQ Table</h3>
<div class="card-tools">
<a class="btn btn-primary" href="{{url('admin/faqs/create')}}" role="button">Create</a>
</div>
</div>
<!-- /.card-header -->
<div class="card-body">
@include('success.success')
@include('errors.error')
<form id="search" class="search-form">
<div class="row">
<div class="input-group input-group-sm mb-3 table-search col-md-3">
<input type="search" name="name" class="form-control ds-input" placeholder="Question / Answer" aria-label="Small" aria-describedby="inputGroup-sizing-sm" onchange="filterList()">
</div>
<div class="input-group input-group-sm mb-3 table-search col-md-3">
<select name="status" class="form-control ds-input" onchange="filterList()">
<option value="" disabled selected>Search By Status</option>
@foreach(config('custom.status') as $in => $val)
<option value="{{$in}}">{{$val}}</option>
@endforeach
</select>
</div>
</div>
</form>
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 10px">S.N.</th>
<th class="text-center">Question</th>
<th class="text-center">Answer</th>
<th class="text-center">Status</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach($settings as $setting)
<tr>
<th scope="row">{{$loop->iteration}}</th>
<td class="text-center">{{$setting->question}}</td>
<td class="text-center">{!! $setting->answer !!}</td>
<td class="text-center">{{config('custom.status')[$setting->status]}}</td>
<td class="text-center">
<a class="btn btn-primary btn-sm" href="{{url('admin/faqs/'.$setting->id)}}">
<i class="fas fa-folder">
</i>
View
</a>
<a class="btn btn-info btn-sm" href="{{url('admin/faqs/'.$setting->id.'/edit')}}">
<i class="fas fa-pencil-alt">
</i>
Edit
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
<div style="margin-top: 10px;">
{!! $settings->links() !!}
</div>
</div>
</div>
<!-- /.card -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div><!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
@endsection

@ -0,0 +1,86 @@
@extends('admin.layouts.app')
@section('content')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>FAQs</h1>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- Main content -->
<section class="content">
<div class="container-fluid">
<!-- SELECT2 EXAMPLE -->
<div class="card card-default">
<div class="card-header">
<h3 class="card-title">View FAQ</h3>
<a href="{{url('admin/faqs')}}" class="back-button">List</a>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-12" >
<div class="form-group" >
<label>Question <span style="color: red">*</span> </label>
<textarea name="question" class="summernote_class" rows="5" style="height: 658px;" >{{$setting->question}}
</textarea>
</div>
</div>
<div class="col-md-12" >
<div class="form-group" >
<label>Answer <span style="color: red">*</span> </label>
<textarea name="answer" class="summernote_class" rows="5" style="height: 658px;" >{{$setting->answer}}
</textarea>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>Status <span style="color: red">*</span> </label>
<select name="status" class="form-control" id="type" required disabled>
<option value="" selected disabled>Please select Status</option>
@foreach(config('custom.status') as $in => $val)
<option value="{{$in}}" {{($setting->status==$in) ? 'selected' : '' }}> {{$val}} </option>
@endforeach
</select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="value_section">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
@endsection
@section('script')
<script>
$(document).ready(function() {
$('.summernote_class').summernote()
})
</script>
@endsection

@ -140,6 +140,14 @@
</p>
</a>
</li>
<li class="nav-item">
<a href="{{url('admin/faqs')}}" class="nav-link {{(Request::segment(2) == 'faqs') ? 'active' : ''}}">
<i class="fa fa-quote-right" aria-hidden="true"></i>
<p>
FAQs
</p>
</a>
</li>

@ -9,33 +9,37 @@
<meta property="og:description" content="ET Education and Visa Services, presented by Extratech, is an adept provider of excellent education consultation, information, and visa guidance solution to students seeking schooling abroad."/>
@endsection
@section('content')
<section class="abroad-banner-section" style="background: url('frontend/images/faq-banner.png')">
<nav aria-label="breadcrumb">
<section class="abroad-banner-section" style="background: url({{url($page->banner_image)}})">
<!-- <nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item active" aria-current="page">Study Abroad</li>
</ol>
</nav>
</nav> -->
<div class="studyabroad-banner-header">
<h1>I have a Question</h1>
<h5>Know what’s trending overseas</h5>
<h5>{{$page->sub_title}}</h5>
</div>
</section>
<section class="faq-section">
<h1>Frequently Asked Questions</h1>
<div class="accordion" id="accordionExample">
@foreach($faqs as $faq)
<div class="accordion-item">
<h2 class="accordion-header" id="heading">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse" aria-expanded="false" aria-controls="collapse">
<img src="{{url('frontend/images/faq-lists.png')}}" class="mx-2" alt=""> How can ET Education help me while I apply a visa to study in Australia?
<h2 class="accordion-header" id="heading{{$faq->id}}">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{$faq->id}}" aria-expanded="false" aria-controls="collapse{{$faq->id}}">
<img src="{{url('frontend/images/faq-lists.png')}}" class="mx-2" alt=""> {{$faq->question}}
</button>
</h2>
<div id="collapse" class="accordion-collapse collapse" aria-labelledby="heading" data-bs-parent="#accordionExample">
<div id="collapse{{$faq->id}}" class="accordion-collapse collapse" aria-labelledby="heading{{$faq->id}}" data-bs-parent="#accordionExample">
<div class="accordion-body">
We have a team of experienced education consultants and Registered Migration Agents with a combined experience of 50+ years. We will assist you with finding the right visa type and lodging your application throughout the Australia study visa process.
{{$faq->answer}}
</div>
</div>
</div>
@endforeach
</div>
</section>
@endsection

@ -10,6 +10,7 @@ use App\Http\Controllers\Admin\ReferralController as ReferralAdminController;
use App\Http\Controllers\RecruitmentController;
use App\Http\Controllers\BlogController;
use App\Http\Controllers\AboutUsController as FrontendAboutUsController;
use App\Http\Controllers\FaqController as FrontendFaqController;
use App\Http\Controllers\Admin\ServiceSectionController;
use App\Http\Controllers\Admin\AccomodationController;
use App\Http\Controllers\Admin\ContactUsController;
@ -34,6 +35,7 @@ use App\Http\Controllers\Admin\ServiceFaqController;
use App\Http\Controllers\Admin\AddSectionController;
use App\Http\Controllers\Admin\SeoTitleController;
use App\Http\Controllers\Admin\VisaServiceController;
use App\Http\Controllers\Admin\FaqController;
use App\Http\Controllers\Admin\VisaServiceSectionController;
use App\Http\Controllers\Admin\TeamController;
@ -70,9 +72,7 @@ Route::get('about', [FrontendAboutUsController::class,'index']);
// });
Route::get('blogs', [BlogController::class,'index']);
Route::get('blog/{slug}', [BlogController::class,'blog_detail']);
Route::get('/faq', function () {
return view('faq');
});
Route::get('faqs', [FrontendFaqController::class,'index']);
Route::post('image-upload', [ImageUploadController::class, 'storeImage'])->name('image.upload'); //upload image in CkEditor
Route::group(['middleware'=>['auth']],function (){
@ -219,11 +219,12 @@ Route::group(['middleware'=>['auth']],function (){
Route::post('clients/{id}',[ClientController::class,'update']);
Route::get('service_faqs',[ServiceFaqController::class,'index']);
Route::get('service_faqs/create',[ServiceFaqController::class,'create']);
Route::post('service_faqs',[ServiceFaqController::class,'store']);
Route::get('service_faqs/{id}/edit',[ServiceFaqController::class,'edit']);
Route::post('service_faqs/{id}',[ServiceFaqController::class,'update']);
Route::get('faqs',[FaqController::class,'index']);
Route::get('faqs/create',[FaqController::class,'create']);
Route::post('faqs',[FaqController::class,'store']);
Route::get('faqs/{id}/edit',[FaqController::class,'edit']);
Route::post('faqs/{id}',[FaqController::class,'update']);
Route::get('faqs/{id}',[FaqController::class,'show']);
Route::get('add-sections',[AddSectionController::class,'index']);
Route::get('add-sections/create',[AddSectionController::class,'create']);

Loading…
Cancel
Save