2020-10-26 16:01:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
2022-03-15 16:27:41 +01:00
|
|
|
namespace App\Http\Controllers\Fo;
|
2020-10-26 16:01:14 +01:00
|
|
|
|
2022-03-15 16:27:41 +01:00
|
|
|
use App\Http\Controllers\Controller;
|
2022-01-11 12:39:28 +01:00
|
|
|
use App\Models\FaqQuestion;
|
|
|
|
|
use App\Models\FaqTheme;
|
2020-10-26 16:01:14 +01:00
|
|
|
|
|
|
|
|
class FAQController extends Controller
|
|
|
|
|
{
|
2022-03-15 16:27:41 +01:00
|
|
|
/**
|
|
|
|
|
* Faq page
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
|
|
|
|
*/
|
2021-08-18 17:08:02 +02:00
|
|
|
public function index()
|
|
|
|
|
{
|
2022-01-11 12:39:28 +01:00
|
|
|
$questions = FaqQuestion::all();
|
|
|
|
|
$themes = FaqTheme::all();
|
2021-08-18 17:08:02 +02:00
|
|
|
if (count($questions) === 0 && count($themes) === 0) {
|
2020-11-12 17:22:54 +01:00
|
|
|
return redirect()->route('home');
|
2021-08-18 17:08:02 +02:00
|
|
|
}
|
2020-10-26 16:01:14 +01:00
|
|
|
return view('front.basic.faq', compact('questions', 'themes'));
|
|
|
|
|
}
|
|
|
|
|
}
|