2020-10-26 16:01:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
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-08-11 10:26:29 +02:00
|
|
|
/**
|
|
|
|
|
* index
|
2023-08-24 12:59:51 +00:00
|
|
|
*
|
2022-08-11 10:26:29 +02:00
|
|
|
* @return \Illuminate\View\View
|
|
|
|
|
*/
|
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
|
|
|
}
|
2023-11-21 12:28:09 +01:00
|
|
|
return view('theme::fo.faq', compact('questions', 'themes'));
|
2020-10-26 16:01:14 +01:00
|
|
|
}
|
|
|
|
|
}
|