<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Widgets;
use App\Faq;
use App\Pages;

class FAQController extends Controller
{
    public function __construct()
    {

    }

    public function index()
    {

        $data["faqs"] = Faq::where('status', '1')->get();

        $data["sec1"] = Pages::where('AccessURL', 'frequentlu-asked-questions')->first();
        if ($data["sec1"]->IsPermanentRedirect == "Yes" && !empty($data["sec1"]->PermanentRedirectURL)) {
            // dd($data["sec1"]->PermanentRedirectURL);
            return redirect($data["sec1"]->PermanentRedirectURL);
        }
        $data["sec3"] = Widgets::where('code', 'index_sec_4')->first();
        $data["headerClass"] = 'no-banner';
        return view('front/faq', $data);

    }
}