57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
use App\Enums\StaticPageType;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\StaticPage;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
class StaticPageController extends Controller
|
|
{
|
|
/**
|
|
* Show the rules view
|
|
*
|
|
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
|
*/
|
|
public function reglement()
|
|
{
|
|
$staticPageModel = StaticPage::query()->where('type', StaticPageType::rules)->firstOrFail();
|
|
return $this->viewStaticPage($staticPageModel);
|
|
}
|
|
|
|
/**
|
|
* Show the privacy view
|
|
*
|
|
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
|
*/
|
|
public function charte()
|
|
{
|
|
$staticPageModel = StaticPage::query()->where('type', StaticPageType::confidentiality)->firstOrFail();
|
|
return $this->viewStaticPage($staticPageModel);
|
|
}
|
|
|
|
/**
|
|
* Show the legals view
|
|
*
|
|
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
|
*/
|
|
public function legals()
|
|
{
|
|
$staticPageModel = StaticPage::query()->where('type', StaticPageType::legals)->firstOrFail();
|
|
return $this->viewStaticPage($staticPageModel);
|
|
}
|
|
|
|
/**
|
|
* Display a static page
|
|
*
|
|
* @param \App\Models\StaticPage $staticPageModel
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
private function viewStaticPage(StaticPage $staticPageModel): View
|
|
{
|
|
return view('theme::pages.static_page', [
|
|
'staticPageModel' => $staticPageModel
|
|
]);
|
|
}
|
|
}
|